data-science-ipython-notebooks/numpy/numpy.ipynb

879 lines
55 KiB
Python
Raw Normal View History

{
2015-04-15 02:19:07 +08:00
"cells": [
{
2015-04-15 02:19:07 +08:00
"cell_type": "markdown",
"metadata": {},
"source": [
"# NumPy\n",
"\n",
2015-05-31 21:38:47 +08:00
"Credits: Forked from [Parallel Machine Learning with scikit-learn and IPython](https://github.com/ogrisel/parallel_ml_tutorial) by Olivier Grisel\n",
"\n",
2015-04-15 02:19:07 +08:00
"* NumPy Arrays, dtype, and shape\n",
"* Common Array Operations\n",
"* Reshape and Update In-Place\n",
"* Combine Arrays\n",
"* Create Sample Data"
]
},
{
"cell_type": "code",
"execution_count": 1,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [],
"source": [
"import numpy as np"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## NumPy Arrays, dtypes, and shapes"
]
},
{
"cell_type": "code",
"execution_count": 2,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[1 2 3]\n",
"(3,)\n",
"int64\n"
]
2015-04-15 02:19:07 +08:00
}
],
"source": [
"a = np.array([1, 2, 3])\n",
"print(a)\n",
"print(a.shape)\n",
"print(a.dtype)"
]
},
{
"cell_type": "code",
"execution_count": 3,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[0 2 4]\n",
" [1 3 5]]\n",
"(2, 3)\n",
"int64\n"
]
2015-04-15 02:19:07 +08:00
}
],
"source": [
"b = np.array([[0, 2, 4], [1, 3, 5]])\n",
"print(b)\n",
"print(b.shape)\n",
"print(b.dtype)"
]
},
{
"cell_type": "code",
"execution_count": 4,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"array([ 0., 0., 0., 0., 0.])"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.zeros(5)"
]
},
{
"cell_type": "code",
"execution_count": 5,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"array([[1, 1, 1, 1],\n",
" [1, 1, 1, 1],\n",
" [1, 1, 1, 1]], dtype=int32)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.ones(shape=(3, 4), dtype=np.int32)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Common Array Operations"
]
},
{
"cell_type": "code",
"execution_count": 6,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[ 0. 1. 2. ]\n",
" [ 0.5 1.5 2.5]]\n",
"(2, 3)\n",
"float64\n"
]
2015-04-15 02:19:07 +08:00
}
],
"source": [
"c = b * 0.5\n",
"print(c)\n",
"print(c.shape)\n",
"print(c.dtype)"
]
},
{
"cell_type": "code",
"execution_count": 7,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[ 1. 3. 5. ]\n",
" [ 1.5 3.5 5.5]]\n"
]
2015-04-15 02:19:07 +08:00
}
],
"source": [
"d = a + c\n",
"print(d)"
]
},
{
"cell_type": "code",
"execution_count": 8,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"array([ 1., 3., 5.])"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d[0]"
]
},
{
"cell_type": "code",
"execution_count": 9,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"1.0"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d[0, 0]"
]
},
{
"cell_type": "code",
"execution_count": 10,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"array([ 1. , 1.5])"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d[:, 0]"
]
},
{
"cell_type": "code",
"execution_count": 11,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"19.5"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d.sum()"
]
},
{
"cell_type": "code",
"execution_count": 12,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"3.25"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d.mean()"
]
},
{
"cell_type": "code",
"execution_count": 13,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"array([ 2.5, 6.5, 10.5])"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d.sum(axis=0)"
]
},
{
"cell_type": "code",
"execution_count": 14,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"array([ 3. , 3.5])"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d.mean(axis=1)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Reshape and Update In-Place"
]
},
{
"cell_type": "code",
"execution_count": 15,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[ 0 1 2 3 4 5 6 7 8 9 10 11]\n"
]
2015-04-15 02:19:07 +08:00
}
],
"source": [
"e = np.arange(12)\n",
"print(e)"
]
},
{
"cell_type": "code",
"execution_count": 16,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[ 0 1 2 3]\n",
" [ 4 5 6 7]\n",
" [ 8 9 10 11]]\n"
]
}
],
2015-04-15 02:19:07 +08:00
"source": [
"# f is a view of contents of e\n",
"f = e.reshape(3, 4)\n",
"print(f)"
]
},
{
"cell_type": "code",
"execution_count": 17,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[0 1 2 3 4 0 0 0 0 0 0 0]\n"
]
}
],
"source": [
2015-08-01 22:09:23 +08:00
"# Set values of e from index 5 onwards to 0\n",
2015-04-15 02:19:07 +08:00
"e[5:] = 0\n",
"print(e)"
]
},
{
"cell_type": "code",
"execution_count": 18,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"array([[0, 1, 2, 3],\n",
" [4, 0, 0, 0],\n",
" [0, 0, 0, 0]])"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# f is also updated\n",
"f"
]
},
{
"cell_type": "code",
"execution_count": 19,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
" C_CONTIGUOUS : True\n",
" F_CONTIGUOUS : False\n",
" OWNDATA : False\n",
" WRITEABLE : True\n",
" ALIGNED : True\n",
" UPDATEIFCOPY : False"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# OWNDATA shows f does not own its data\n",
"f.flags"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Combine Arrays"
]
},
{
"cell_type": "code",
"execution_count": 20,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"array([1, 2, 3])"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a"
]
},
{
"cell_type": "code",
"execution_count": 21,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"array([[0, 2, 4],\n",
" [1, 3, 5]])"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"b"
]
},
{
"cell_type": "code",
"execution_count": 22,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"array([[ 1. , 3. , 5. ],\n",
" [ 1.5, 3.5, 5.5]])"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d"
]
},
{
"cell_type": "code",
"execution_count": 23,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"array([1, 2, 3, 1, 2, 3, 1, 2, 3])"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.concatenate([a, a, a])"
]
},
{
"cell_type": "code",
"execution_count": 24,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"array([[ 1. , 2. , 3. ],\n",
" [ 0. , 2. , 4. ],\n",
" [ 1. , 3. , 5. ],\n",
" [ 1. , 3. , 5. ],\n",
" [ 1.5, 3.5, 5.5]])"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Use broadcasting when needed to do this automatically\n",
"np.vstack([a, b, d])"
]
},
{
"cell_type": "code",
"execution_count": 25,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"text/plain": [
"array([[ 0. , 2. , 4. , 1. , 3. , 5. ],\n",
" [ 1. , 3. , 5. , 1.5, 3.5, 5.5]])"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# In machine learning, useful to enrich or \n",
"# add new/concatenate features with hstack\n",
"np.hstack([b, d])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Create Sample Data"
]
},
{
"cell_type": "code",
2022-03-26 15:41:10 +08:00
"execution_count": 2,
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [],
"source": [
"%matplotlib inline\n",
"\n",
"import pylab as plt\n",
"import seaborn\n",
"\n",
"seaborn.set()"
]
},
{
"cell_type": "code",
"execution_count": 27,
2022-03-26 15:41:10 +08:00
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeMAAAFVCAYAAADc5IdQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtwVOed5vGnG4QsUEfIThtsS0aOjF5dBjzxLTGyPcYp\neYORnDhmk0lIdsCIyUzwkpmprVTG2aS2pmarXGVI1Xg9MzWL8MZ2ZWELk2yCZBNjO/bGhM0wWBOS\nIF4wRjIei42MBS0QunbvH90yuqulvpw+53w/Va7i9Gm1fq9F8+icPv10IBaLCQAAOCfo9AAAAPgd\nYQwAgMMIYwAAHEYYAwDgMMIYAACHEcYAADhs/nQ7jTF5kp6RtExSvqS/tdbuG7W/QdJ3JQ1JesZa\n25TBWQEA8KSZjozXS+qy1t4r6bOSnh7ZkQjq70uqk/RHkv7UGHNtpgYFAMCrZgrjPZK+N+q+Q6P2\nVUl621p7wVo7KOlNSfemf0QAALxt2tPU1tpLkmSMCSkezN8Ztftjki6M2u6RVJTuAQEA8Lppw1iS\njDGlkn4k6e+ttbtH7bogKTRqOySpe7rHisVisUAgMJc5AQBwhd6+QX3pOy+OuW3f9s9NG34zXcC1\nRNLLkr5hrf35uN3HJS03xhRLuqT4Keonp3u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/SNh1dQZ4mMo6cNgO+1jQTxOH0DwwQxsoIwBuB7sSlu5yItZAunqQH41kid5WSK\nQ/na+sjKLE8EvyKMAfjS+DrLwaGoLl4elBQP4u1bah2eEH5CGAPwlcnqLL9SV6EPzvfpqb1HFQwG\n9NjDK5weEz5DGAPwjen
"text/plain": [
"<matplotlib.figure.Figure at 0x10bac8d50>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Create evenly spaced numbers over the specified interval\n",
"x = np.linspace(0, 2, 10)\n",
"plt.plot(x, 'o-');\n",
"plt.show()"
]
},
{
"cell_type": "code",
2022-03-26 15:41:10 +08:00
"execution_count": 3,
"metadata": {},
2015-04-15 02:19:07 +08:00
"outputs": [
{
"data": {
2022-03-26 15:41:10 +08:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWwAAAD7CAYAAABOi672AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8/fFQqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAtKUlEQVR4nO3dfXRU1d0v8O+ZtyQQeMAYjFTaZSMWyAJFr9UYrwFrQQgRm3qvwiqxxfqURy9a2qVSa3W1q7rAl0uLLp91l4qKVVq9ojY8REV5qYT0WqkIzQtaFAQhGobQEJhM5uXcP+IZzsyc95kzc87M97OWSzKZObN3MvnNnr1/+7cFURRFEBGR43ny3QAiIjKGAZuIyCUYsImIXIIBm4jIJRiwiYhcggGbiMglGLCJiFzCZ/cT9PWdRDxuLNW7oqIcweCAzS1ynmLsdzH2GSjOfhdjnwHr/fZ4BIwdO1Lxe7YH7HhcNBywpfsXo2LsdzH2GSjOfhdjn4Hs95tTIkRELsGATUTkEgzYREQuwYBNROQSti86EhG5WXtHD9Zv24dgfxgVo0vQVF+N2pqqvLSFAZuISEV7Rw+ea+3GUDQOAAj2h/FcazcA5CVoc0qEiEjF+m37EsFaMhSNY/22fXlpDwM2EZGKYH/Y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7qs0SyItbuodSpvNVCtAfXFqZKk3689llVcAbpozGQuuPj/RplEjAnltk9W1iWhURHtHT1YzMOSk142R12guN0txhE2GmDkGSy31LvXkFTMjIzPzzmq7/eSZKoND2a1QpzQCC/g8WPjdb6G2psq2j+5mLJ43BQDSPqnkS8DnwYKrz7f0aScmDr8
2015-04-15 02:19:07 +08:00
"text/plain": [
2022-03-26 15:41:10 +08:00
"<Figure size 432x288 with 1 Axes>"
2015-04-15 02:19:07 +08:00
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Create sample data, add some noise\n",
"x = np.random.uniform(1, 100, 1000)\n",
"y = np.log(x) + np.random.normal(0, .3, 1000)\n",
"\n",
"plt.scatter(x, y)\n",
"plt.show()"
]
2022-03-26 15:41:10 +08:00
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([83.71854922, 56.42008614, 49.98694964, 93.27834525, 30.27524716,\n",
" 41.76569611, 68.77139894, 53.85135531, 59.70938725, 47.94039486,\n",
" 92.2794264 , 36.65789096, 34.12233513, 42.93989704, 96.31092964,\n",
" 66.42623987, 29.29202337, 77.42591982, 23.93583307, 46.1117102 ,\n",
" 83.87098271, 31.48546596, 37.03181147, 34.55065443, 82.69943861,\n",
" 48.04544156, 55.28137272, 20.41569089, 34.44386826, 31.33208191,\n",
" 68.82291735, 16.49416034, 67.52775054, 59.26870595, 34.59416856,\n",
" 46.22618212, 43.02653129, 13.29699634, 85.87035581, 49.10256099,\n",
" 53.80913102, 55.4370286 , 97.59276738, 76.54251692, 12.44899516,\n",
" 24.13297416, 85.94900525, 65.19726131, 92.77112099, 61.05600087,\n",
" 51.97623268, 74.50004466, 12.96078586, 8.45321199, 93.23475918,\n",
" 20.50258396, 20.82425681, 63.75744397, 85.98146324, 6.58818749,\n",
" 34.13121031, 8.77033903, 57.16966461, 55.99761995, 49.8286924 ,\n",
" 78.83044349, 39.80510984, 30.84804662, 82.28398022, 9.93416381,\n",
" 96.76791686, 21.62560876, 21.44950404, 44.30021138, 63.63334457,\n",
" 83.91351217, 76.57204104, 2.85709746, 54.09131354, 98.20915521,\n",
" 95.45205648, 52.47789366, 63.49178726, 85.79772374, 61.87730851,\n",
" 63.6599729 , 78.42832639, 61.15016663, 9.19537288, 62.64767869,\n",
" 9.9441762 , 30.96488801, 7.00401788, 25.45784566, 22.92861064,\n",
" 78.9518552 , 96.70412501, 41.92897161, 88.27740138, 19.82953716,\n",
" 19.99840143, 24.62332795, 92.57234839, 4.3085906 , 8.39897054,\n",
" 86.61940807, 34.73652668, 43.93647878, 87.84859818, 12.75033582,\n",
" 14.73741943, 98.10399493, 31.25375293, 64.34812438, 19.68005629,\n",
" 25.67171446, 60.39612831, 89.35139282, 96.57952059, 84.05577647,\n",
" 56.69683168, 53.74545209, 48.56017275, 18.68125305, 3.72073321,\n",
" 93.53363915, 12.02587833, 89.5376834 , 46.04924518, 77.99515893,\n",
" 46.32252998, 81.40921193, 27.34338734, 37.47268845, 75.78202532,\n",
" 38.29284779, 42.6343433 , 96.01020265, 97.81660871, 93.35310544,\n",
" 20.24738001, 98.46825771, 13.712137 , 33.77227359, 29.40031081,\n",
" 54.28727788, 48.83005544, 5.6674515 , 21.1620685 , 51.63380767,\n",
" 17.21803125, 8.61133232, 91.29855571, 87.72501975, 25.12385243,\n",
" 69.13211569, 14.47254943, 7.38473232, 44.51243476, 38.34570006,\n",
" 72.81345911, 38.12407287, 6.4085569 , 69.84395616, 6.73123685,\n",
" 69.69176786, 34.52184721, 64.85272141, 88.58436437, 97.85669547,\n",
" 50.55263643, 90.23285264, 34.54628467, 48.49646617, 89.84304147,\n",
" 70.32288427, 54.40838621, 5.36572988, 16.77505735, 89.75713153,\n",
" 39.20205915, 70.09879834, 72.82545558, 80.63631681, 61.18949255,\n",
" 96.12832008, 89.86338564, 5.78167235, 62.66001616, 45.24619169,\n",
" 68.22110483, 78.50223742, 88.518058 , 45.07746332, 5.52013397,\n",
" 11.82882415, 60.56869955, 87.32315816, 72.04393536, 90.0505615 ,\n",
" 73.76413058, 21.18795344, 31.72529168, 86.39558819, 65.63549891,\n",
" 32.21931223, 16.74065236, 59.59553079, 7.52972462, 93.18470182,\n",
" 52.96095658, 59.30359505, 64.62047666, 26.26466469, 4.81077116,\n",
" 88.31656888, 91.61068173, 4.73609492, 81.33937848, 4.1011709 ,\n",
" 2.57936691, 83.59191756, 17.76511103, 35.260859 , 2.12451695,\n",
" 92.95291768, 44.69776305, 75.06399396, 49.27140805, 70.89682392,\n",
" 54.43181351, 71.29745173, 2.58864544, 75.63705519, 57.98533294,\n",
" 54.09305538, 83.30654764, 76.1120146 , 14.6803717 , 49.61729746,\n",
" 76.32994462, 94.26525748, 91.62397767, 83.37590949, 4.56719842,\n",
" 87.78640149, 85.21532691, 55.27810805, 21.31038537, 20.02479967,\n",
" 82.57333297, 43.6731699 , 48.80470649, 94.82564441, 69.38454334,\n",
" 69.24588824, 23.43682139, 24.69793876, 94.56932991, 4.75665761,\n",
" 31.26874213, 61.27296706, 38.84203184, 52.07511526, 16.74501083,\n",
" 90.10773435, 73.63029533, 45.68134773, 74.21902068, 52.57994729,\n",
" 36.76262087, 23.99745014, 5.97852962, 26.05342092, 7.63304941,\n",
" 36.74485501, 25.85072155, 24.28879386, 46.38647005, 38.54809101,\n",
" 20.08363303, 28.89598316, 65.28138835, 65.89866509, 56.21697962,\n",
" 95.98243925, 39.6996565 , 9.44647706, 12.53545148, 76.65801574,\n",
" 64.16900178, 29.6652737 , 50.68757655, 85.06007367, 66.67179532,\n",
" 73.51785038, 82.33531599, 76.30448981, 18.02927199, 34.79390567,\n",
" 43.35736492, 42.09896227, 24.3227206 , 17.06147181, 22.26837447,\n",
" 11.39338226, 4.0590102 , 41.72233178, 74.59919539, 70.28058278,\n",
" 46.74347735, 50.74540797, 75.3868119 , 81.91549973, 68.66401867,\n",
" 29.46735335, 13.16022997, 37.81641541, 95.18328584, 99.31281745,\n",
" 93.60594966, 37.78951538, 9.58815953, 5.43466928, 29.25084117,\n",
" 61.20781222, 73.65145942, 80.9411392 , 44.84073946, 39.15571455,\n",
" 35.38719918, 33.18527091, 93.57087102, 82.95009024, 23.13348947,\n",
" 99.38503438, 46.41191059, 19.78431723, 92.48274749, 94.35508113,\n",
" 82.55464173, 24.49033533, 13.04648305, 5.33523461, 65.29334281,\n",
" 21.76461102, 53.18091392, 37.88104412, 7.66864866, 86.43601426,\n",
" 42.81323599, 73.73847828, 28.18782878, 9.47024692, 91.33054247,\n",
" 19.13443638, 44.66581638, 64.54085165, 18.7005718 , 97.43973028,\n",
" 27.37321214, 46.5371998 , 70.13804771, 94.12044806, 9.59499349,\n",
" 91.77590893, 23.85416154, 24.81854893, 10.16994817, 61.65265823,\n",
" 30.80094459, 99.88974271, 51.48970062, 64.00534117, 28.32498996,\n",
" 95.96330362, 78.57156869, 11.26172063, 5.12727213, 83.23240357,\n",
" 63.42265511, 7.90992072, 77.6435666 , 41.32153067, 87.12421958,\n",
" 4.58744694, 21.34868307, 38.36679011, 1.11168295, 34.81460997,\n",
" 23.7319703 , 55.55322603, 48.93390941, 66.01891832, 71.46395879,\n",
" 62.992747 , 30.26651591, 28.89364795, 13.02103718, 88.40437453,\n",
" 49.46881189, 56.98669103, 65.94627196, 73.44799534, 7.07694658,\n",
" 57.50564017, 86.69127084, 51.97069366, 40.02469257, 61.93274575,\n",
" 1.58154704, 93.39278209, 82.09048206, 99.30157407, 71.37967429,\n",
" 99.65860368, 26.9048574 , 88.00957877, 63.99884793, 10.28088743,\n",
" 18.48922532, 22.36531754, 72.60527259, 88.6110272 , 28.01144336,\n",
" 17.52897011, 85.50803706, 14.10783113, 62.39177242, 76.29680583,\n",
" 74.94812139, 4.76563935, 88.05763191, 13.73016167, 47.9184943 ,\n",
" 30.94590316, 44.76643412, 54.71164969, 96.50874683, 6.4070926 ,\n",
" 92.91869417, 2.33965435, 24.31750859, 45.16218788, 62.55255338,\n",
" 3.60786013, 77.53976478, 98.73528801, 1.64118966, 35.96948083,\n",
" 63.82340742, 29.28053425, 71.02014774, 28.73677381, 15.76749613,\n",
" 32.00299167, 74.98351357, 19.09729316, 75.85201677, 97.38180446,\n",
" 40.2195637 , 92.80691414, 88.18935951, 47.08953732, 99.64806564,\n",
" 11.97679595, 13.6471891 , 13.29711511, 81.0494752 , 44.25642235,\n",
" 85.61065761, 26.32544564, 99.8654296 , 61.32416734, 75.46948802,\n",
" 73.42675464, 86.08518275, 30.78745229, 92.39237228, 4.69877434,\n",
" 1.78078896, 65.81981226, 4.17379548, 82.92842122, 5.49215947,\n",
" 69.63154521, 85.77172747, 95.26456345, 69.26493585, 8.31519357,\n",
" 14.43209414, 62.24093408, 3.86016656, 58.90288874, 72.78974919,\n",
" 86.08114266, 28.85912804, 42.74809433, 62.12023518, 37.06068036,\n",
" 33.67501142, 72.67099543, 25.8959871 , 19.35368386, 77.86678593,\n",
" 98.17072223, 91.9655844 , 37.40524565, 66.06172207, 21.42105259,\n",
" 12.07382067, 24.46328008, 22.8252266 , 90.31364028, 71.45629137,\n",
" 34.32928778, 49.90021701, 57.82790169, 90.18307693, 52.71020508,\n",
" 4.37248993, 99.19034421, 43.49641918, 91.43200285, 38.88519619,\n",
" 87.31336992, 85.27853155, 38.59268811, 21.38292392, 28.89497952,\n",
" 63.97828694, 9.32114043, 94.2860323 , 67.32812315, 11.59505624,\n",
" 89.60322313, 65.29211118, 28.35101787, 53.15742267, 97.06572541,\n",
" 90.20759753, 99.72005092, 30.54779196, 99.87712067, 51.44041505,\n",
" 77.06212412, 58.00468992, 89.70375746, 11.54967882, 65.99904723,\n",
" 3.54165483, 39.59921523, 18.42266877, 41.91468144, 78.72957495,\n",
" 37.74087603, 46.42494793, 45.51476976, 6.6295963 , 55.56110509,\n",
" 41.70129659, 62.79875187, 43.5800473 , 71.13001042, 66.58592771,\n",
" 34.88457248, 66.36602253, 70.42746458, 28.81987688, 23.82952431,\n",
" 55.54583673, 18.86600223, 71.99843093, 69.58836276, 7.40583417,\n",
" 55.9290922 , 63.88481835, 40.49188544, 81.76814657, 23.91812497,\n",
" 97.12356037, 87.72888049, 23.5467403 , 9.91766421, 54.49355654,\n",
" 94.80589326, 85.0925874 , 42.9035636 , 35.4074615 , 85.74094001,\n",
" 85.29724961, 78.69422009, 93.88531889, 1.91114894, 8.35013631,\n",
" 81.35857237, 96.58928956, 14.96986652, 4.51965273, 18.76465261,\n",
" 48.20441099, 11.01367646, 32.5464884 , 83.91009799, 43.05660662,\n",
" 55.58054646, 85.6051006 , 37.27065264, 29.23600466, 61.98880438,\n",
" 23.40683658, 8.73572281, 12.5780708 , 61.97662 , 75.39708566,\n",
" 30.86608386, 28.23203191, 80.31505372, 9.9430856 , 65.7743332 ,\n",
" 80.53733201, 90.75376285, 50.19607544, 67.80631336, 7.65902916,\n",
" 25.52639161, 32.78467178, 58.53780351, 66.21926794, 32.82406798,\n",
" 48.56459098, 31.916896 , 22.19556823, 87.98891375, 33.93848311,\n",
" 89.87015706, 43.46471924, 78.99058464, 74.8917485 , 53.49389516,\n",
" 34.16920218, 8.36695026, 35.05523802, 36.44041851, 67.32627207,\n",
" 20.68761506, 75.28144536, 81.84296375, 75.05291647, 25.89441905,\n",
" 41.71943856, 60.32045188, 67.49597781, 8.59341878, 16.35732665,\n",
" 82.27752258, 84.0430634 , 21.89443452, 57.84318896, 76.33390719,\n",
" 5.03865717, 32.87868733, 39.98074345, 58.72895018, 53.89488776,\n",
" 16.84976396, 76.37786876, 88.30790222, 95.18498538, 88.43881969,\n",
" 10.74906256, 64.96716397, 6.38143823, 71.6895052 , 17.87446043,\n",
" 57.62254779, 70.70280433, 13.58816799, 21.27095675, 73.02813501,\n",
" 14.54336889, 81.12768622, 36.43237455, 98.33159296, 77.1175084 ,\n",
" 56.32993189, 37.77787235, 86.15033356, 95.1657446 , 56.1391928 ,\n",
" 3.33269156, 87.51147207, 12.48020131, 37.38358574, 51.82399254,\n",
" 85.17045198, 10.06535465, 4.38184052, 88.72640384, 56.32410384,\n",
" 5.68598327, 36.82194916, 92.78379779, 33.39425213, 54.95334915,\n",
" 85.94358896, 83.63198392, 31.14138104, 25.76465325, 40.10815033,\n",
" 29.93102743, 87.82450043, 87.0613059 , 98.5794072 , 55.842131 ,\n",
" 79.01925454, 7.70400408, 52.11817952, 30.8189784 , 2.91965406,\n",
" 13.6781815 , 15.12406058, 56.79443758, 26.53000083, 30.88338582,\n",
" 65.50542143, 6.82709354, 54.19720068, 45.04461585, 87.87798472,\n",
" 73.27065288, 54.22309175, 96.22197906, 23.35058715, 37.97415674,\n",
" 72.42933878, 20.0757852 , 95.37401501, 85.05327666, 61.81980442,\n",
" 69.05262958, 2.47239674, 32.78089927, 18.97786073, 14.66373124,\n",
" 64.38037433, 14.06439643, 7.88521442, 34.27349917, 91.30270012,\n",
" 50.77830259, 39.92756108, 64.42967576, 54.25245251, 18.46216324,\n",
" 16.3073457 , 3.21559196, 90.83863994, 82.88699709, 96.34412644,\n",
" 64.48614797, 79.30412286, 69.83996183, 47.19306815, 31.05912063,\n",
" 91.19304615, 79.1326671 , 20.91611598, 53.23337673, 40.79977915,\n",
" 75.96391179, 91.31188341, 4.60932064, 60.02520109, 80.06573205,\n",
" 28.56731442, 10.91341691, 89.2289396 , 33.27688809, 88.98493405,\n",
" 22.49696371, 27.43148086, 64.56889446, 47.91786999, 83.40675052,\n",
" 94.32205803, 74.6907083 , 69.04350503, 82.47487169, 28.93519227,\n",
" 46.39544481, 78.34537786, 12.09724051, 14.53354392, 82.302103 ,\n",
" 17.19395458, 29.60479998, 69.93440739, 92.85866959, 61.61931256,\n",
" 5.80564087, 50.15101646, 81.28072275, 36.94549342, 4.36878219,\n",
" 5.87871949, 94.00096934, 65.22752929, 60.66694428, 88.27438076,\n",
" 40.56594596, 23.74457297, 79.11077282, 34.30046574, 24.68386668,\n",
" 99.08402707, 12.97650105, 78.91590839, 85.80182735, 95.04699804,\n",
" 71.64920897, 13.5941554 , 80.01214555, 80.58090451, 64.91685865,\n",
" 48.60988235, 11.78744087, 76.5527322 , 46.72406034, 88.70228966,\n",
" 17.0732701 , 51.73385222, 41.25930885, 24.11436322, 47.46343385,\n",
" 27.79711887, 64.86774917, 74.91027445, 60.12828689, 69.29063747,\n",
" 46.42082819, 77.06172463, 28.75769098, 25.38818924, 62.86101569,\n",
" 62.17339483, 60.23323666, 28.43954838, 11.10739197, 55.77612286,\n",
" 12.67580226, 95.40992531, 62.42992154, 56.06482565, 46.12781689,\n",
" 12.03525238, 9.89705202, 52.74351118, 94.65177242, 56.47294124,\n",
" 15.82019626, 20.38215606, 2.38069139, 56.81831224, 80.84914494,\n",
" 14.53097875, 88.48943365, 92.97658183, 92.57013978, 49.40256786,\n",
" 56.06991209, 81.67945331, 97.11608435, 4.92776729, 1.3771565 ,\n",
" 91.31110986, 90.80864324, 15.9037535 , 85.81519919, 79.76466967,\n",
" 53.39190823, 40.88215654, 35.98198293, 91.2566525 , 69.75144119,\n",
" 21.32552851, 48.98342546, 30.83134303, 3.02042083, 8.62269438,\n",
" 31.47233402, 90.3420669 , 1.00491528, 41.7978035 , 21.63776208,\n",
" 46.70208863, 59.92869295, 21.55388203, 62.98701444, 4.45183257,\n",
" 88.13512421, 30.57894217, 67.18211241, 7.1852894 , 63.32296695,\n",
" 40.47106611, 82.46440949, 55.99998777, 65.94642036, 17.88883329,\n",
" 84.37839975, 70.25555238, 50.43084756, 37.37166596, 15.05648505,\n",
" 76.20628745, 70.10005939, 52.17012073, 71.61366057, 67.03226755,\n",
" 40.21254478, 8.80774537, 90.83517444, 85.03965457, 18.85223271,\n",
" 77.42658886, 12.59288102, 52.47095802, 20.41637383, 85.87626666,\n",
" 27.87167901, 59.44302695, 18.20788808, 10.44638281, 56.79568224,\n",
" 37.6338477 , 52.92135026, 68.42349055, 34.1362987 , 52.95759166,\n",
" 92.21537018, 1.66060537, 88.44675783, 80.98066845, 3.28514697,\n",
" 54.01542978, 13.65847397, 16.99730425, 7.76964967, 3.88317039,\n",
" 93.86374579, 36.13225968, 60.96492413, 29.45753097, 88.3003696 ,\n",
" 97.0733586 , 27.05594121, 24.92214054, 93.61527649, 11.9576937 ,\n",
" 99.84326102, 1.267823 , 46.33099186, 75.86836483, 70.78338433,\n",
" 74.47149114, 88.04387566, 7.42541445, 17.97614452, 27.59771801,\n",
" 23.26554208, 41.1571498 , 59.49604902, 65.47981923, 74.44316543,\n",
" 20.58415102, 84.83878697, 46.34912541, 42.00300668, 15.54338058,\n",
" 89.30469477, 94.97632108, 15.11922228, 26.02091974, 50.66762452,\n",
" 41.08850685, 5.11189478, 91.92108523, 67.04864043, 14.66461341,\n",
" 97.22322874, 76.70158353, 96.63558981, 52.79773946, 66.26472366,\n",
" 17.74787387, 19.5352013 , 74.25434184, 12.53154567, 64.76064791])"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"x"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
2015-04-15 02:19:07 +08:00
],
"metadata": {
"kernelspec": {
2022-03-26 15:41:10 +08:00
"display_name": "Python 3 (ipykernel)",
2015-04-15 02:19:07 +08:00
"language": "python",
2022-03-26 15:41:10 +08:00
"name": "python3"
2015-04-15 02:19:07 +08:00
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
2022-03-26 15:41:10 +08:00
"version": 3
2015-04-15 02:19:07 +08:00
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
2022-03-26 15:41:10 +08:00
"pygments_lexer": "ipython3",
"version": "3.9.7"
2015-04-15 02:19:07 +08:00
}
},
"nbformat": 4,
2022-03-26 15:41:10 +08:00
"nbformat_minor": 1
2015-04-15 02:19:07 +08:00
}