From 2bfffa808b225fefb2f42499abbcb686c55f522d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Sk=C3=B3rzewski?= Date: Wed, 10 Mar 2021 07:58:23 +0100 Subject: [PATCH] =?UTF-8?q?Uporz=C4=85dkowanie=20lab.=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lab/01_Python.ipynb | 689 +++++++++----------------------------------- 1 file changed, 134 insertions(+), 555 deletions(-) diff --git a/lab/01_Python.ipynb b/lab/01_Python.ipynb index 60bb260..f251509 100644 --- a/lab/01_Python.ipynb +++ b/lab/01_Python.ipynb @@ -22,7 +22,7 @@ }, { "cell_type": "code", - "execution_count": 78, + "execution_count": 1, "metadata": {}, "outputs": [ { @@ -43,7 +43,7 @@ }, { "cell_type": "code", - "execution_count": 79, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -68,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -90,7 +90,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -128,7 +128,7 @@ }, { "cell_type": "code", - "execution_count": 80, + "execution_count": 6, "metadata": { "scrolled": true }, @@ -148,7 +148,7 @@ }, { "cell_type": "code", - "execution_count": 81, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -166,7 +166,7 @@ }, { "cell_type": "code", - "execution_count": 82, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -187,7 +187,7 @@ }, { "cell_type": "code", - "execution_count": 83, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -205,7 +205,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -235,7 +235,7 @@ }, { "cell_type": "code", - "execution_count": 84, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -262,7 +262,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -296,7 +296,7 @@ }, { "cell_type": "code", - "execution_count": 85, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -323,7 +323,7 @@ }, { "cell_type": "code", - "execution_count": 86, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -352,7 +352,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -382,7 +382,7 @@ }, { "cell_type": "code", - "execution_count": 88, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -428,7 +428,7 @@ }, { "cell_type": "code", - "execution_count": 91, + "execution_count": 17, "metadata": {}, "outputs": [ { @@ -451,7 +451,7 @@ }, { "cell_type": "code", - "execution_count": 97, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -473,7 +473,7 @@ }, { "cell_type": "code", - "execution_count": 98, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -494,7 +494,7 @@ }, { "cell_type": "code", - "execution_count": 99, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -511,7 +511,7 @@ }, { "cell_type": "code", - "execution_count": 100, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -528,7 +528,7 @@ }, { "cell_type": "code", - "execution_count": 102, + "execution_count": 22, "metadata": {}, "outputs": [ { @@ -550,7 +550,7 @@ }, { "cell_type": "code", - "execution_count": 103, + "execution_count": 23, "metadata": {}, "outputs": [ { @@ -567,7 +567,7 @@ }, { "cell_type": "code", - "execution_count": 107, + "execution_count": 24, "metadata": {}, "outputs": [ { @@ -593,7 +593,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 25, "metadata": {}, "outputs": [ { @@ -602,9 +602,9 @@ "text": [ "(2, 5)\n", "[[ 1. 2. ]\n", - " [ 3. 4. ]\n", + " [ 3. -4.5 ]\n", " [ 5. 10. ]\n", - " [ 9. 8. ]\n", + " [ 9. -8. ]\n", " [-13. 0.39]]\n", "(5, 2)\n" ] @@ -620,7 +620,7 @@ }, { "cell_type": "code", - "execution_count": 108, + "execution_count": 26, "metadata": {}, "outputs": [ { @@ -641,7 +641,7 @@ }, { "cell_type": "code", - "execution_count": 115, + "execution_count": 27, "metadata": {}, "outputs": [ { @@ -658,7 +658,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 28, "metadata": {}, "outputs": [ { @@ -679,7 +679,7 @@ }, { "cell_type": "code", - "execution_count": 119, + "execution_count": 29, "metadata": {}, "outputs": [ { @@ -698,7 +698,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 30, "metadata": {}, "outputs": [ { @@ -719,7 +719,7 @@ }, { "cell_type": "code", - "execution_count": 120, + "execution_count": 31, "metadata": {}, "outputs": [ { @@ -737,7 +737,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 32, "metadata": {}, "outputs": [ { @@ -746,7 +746,7 @@ "array([12, 15, 18])" ] }, - "execution_count": 9, + "execution_count": 32, "metadata": {}, "output_type": "execute_result" } @@ -757,7 +757,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 33, "metadata": {}, "outputs": [ { @@ -766,7 +766,7 @@ "array([2., 5., 8.])" ] }, - "execution_count": 10, + "execution_count": 33, "metadata": {}, "output_type": "execute_result" } @@ -784,7 +784,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 34, "metadata": {}, "outputs": [ { @@ -793,7 +793,7 @@ "array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])" ] }, - "execution_count": 11, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } @@ -804,7 +804,7 @@ }, { "cell_type": "code", - "execution_count": 121, + "execution_count": 35, "metadata": {}, "outputs": [ { @@ -813,7 +813,7 @@ "array([ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14])" ] }, - "execution_count": 121, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -824,7 +824,7 @@ }, { "cell_type": "code", - "execution_count": 127, + "execution_count": 36, "metadata": {}, "outputs": [ { @@ -842,7 +842,7 @@ " [14. , 14.1, 14.2, 14.3, 14.4, 14.5, 14.6, 14.7, 14.8, 14.9]])" ] }, - "execution_count": 127, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -860,7 +860,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 37, "metadata": { "scrolled": true }, @@ -892,7 +892,7 @@ }, { "cell_type": "code", - "execution_count": 128, + "execution_count": 38, "metadata": {}, "outputs": [ { @@ -918,7 +918,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 39, "metadata": {}, "outputs": [ { @@ -979,7 +979,7 @@ }, { "cell_type": "code", - "execution_count": 129, + "execution_count": 40, "metadata": {}, "outputs": [ { @@ -1012,7 +1012,7 @@ }, { "cell_type": "code", - "execution_count": 135, + "execution_count": 41, "metadata": {}, "outputs": [ { @@ -1032,7 +1032,7 @@ }, { "cell_type": "code", - "execution_count": 136, + "execution_count": 42, "metadata": {}, "outputs": [ { @@ -1052,7 +1052,7 @@ }, { "cell_type": "code", - "execution_count": 137, + "execution_count": 43, "metadata": {}, "outputs": [ { @@ -1071,7 +1071,7 @@ }, { "cell_type": "code", - "execution_count": 138, + "execution_count": 44, "metadata": {}, "outputs": [ { @@ -1092,7 +1092,7 @@ }, { "cell_type": "code", - "execution_count": 141, + "execution_count": 45, "metadata": {}, "outputs": [ { @@ -1113,7 +1113,7 @@ }, { "cell_type": "code", - "execution_count": 144, + "execution_count": 46, "metadata": {}, "outputs": [ { @@ -1133,7 +1133,7 @@ }, { "cell_type": "code", - "execution_count": 146, + "execution_count": 47, "metadata": {}, "outputs": [ { @@ -1152,7 +1152,7 @@ }, { "cell_type": "code", - "execution_count": 147, + "execution_count": 48, "metadata": {}, "outputs": [ { @@ -1173,7 +1173,7 @@ }, { "cell_type": "code", - "execution_count": 148, + "execution_count": 49, "metadata": { "scrolled": true }, @@ -1192,7 +1192,7 @@ }, { "cell_type": "code", - "execution_count": 149, + "execution_count": 50, "metadata": {}, "outputs": [ { @@ -1213,7 +1213,7 @@ }, { "cell_type": "code", - "execution_count": 150, + "execution_count": 51, "metadata": {}, "outputs": [ { @@ -1223,7 +1223,7 @@ "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mA\u001b[0m \u001b[1;33m*\u001b[0m \u001b[0mB\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mA\u001b[0m \u001b[1;33m*\u001b[0m \u001b[0mB\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[1;31mValueError\u001b[0m: operands could not be broadcast together with shapes (2,4) (4,3) " ] } @@ -1234,21 +1234,9 @@ }, { "cell_type": "code", - "execution_count": 151, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "ename": "ValueError", - "evalue": "matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 2 is different from 4)", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmatmul\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mA\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mC\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mValueError\u001b[0m: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 2 is different from 4)" - ] - } - ], + "outputs": [], "source": [ "np.matmul(A, C)" ] @@ -1269,18 +1257,9 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[[1 2 3]\n", - " [1 2 3]]\n" - ] - } - ], + "outputs": [], "source": [ "A = np.array([[1, 2, 3], [1, 2, 3]])\n", "B = np.array([[4, 5, 6], [7, 8, 9]])\n", @@ -1290,124 +1269,56 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[[4 5 6]\n", - " [7 8 9]]\n" - ] - } - ], + "outputs": [], "source": [ "print(B)" ] }, { "cell_type": "code", - "execution_count": 62, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[[-3 -3 -3]\n", - " [-6 -6 -6]]\n" - ] - } - ], + "outputs": [], "source": [ "print(A - B)" ] }, { "cell_type": "code", - "execution_count": 63, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[[3 3 3]\n", - " [6 6 6]]\n" - ] - } - ], + "outputs": [], "source": [ "print(B - A)" ] }, { "cell_type": "code", - "execution_count": 64, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[[ 4 10 18]\n", - " [ 7 16 27]]\n" - ] - } - ], + "outputs": [], "source": [ "print(A * B)" ] }, { "cell_type": "code", - "execution_count": 65, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "ename": "ValueError", - "evalue": "matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 2 is different from 3)", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmatmul\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mA\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mB\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mValueError\u001b[0m: matmul: Input operand 1 has a mismatch in its core dimension 0, with gufunc signature (n?,k),(k,m?)->(n?,m?) (size 2 is different from 3)" - ] - } - ], + "outputs": [], "source": [ "np.matmul(A, B)" ] }, { "cell_type": "code", - "execution_count": 72, + "execution_count": null, "metadata": { "scrolled": true }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "(2, 3)\n", - "(3, 4)\n", - "\n", - "[[1 2 3]\n", - " [1 2 3]]\n", - "[[1 2 3 4]\n", - " [9 8 7 6]\n", - " [2 4 6 7]]\n", - "[[25 30 35 37]\n", - " [25 30 35 37]]\n", - "\n", - "(2, 3) (3, 4)\n", - "(2, 4)\n" - ] - } - ], + "outputs": [], "source": [ "print(A.shape)\n", "B = np.array([[1, 2, 3, 4], [9, 8, 7, 6], [2, 4, 6, 7]])\n", @@ -1428,38 +1339,18 @@ }, { "cell_type": "code", - "execution_count": 73, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[25, 30, 35, 37],\n", - " [25, 30, 35, 37]])" - ] - }, - "execution_count": 73, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "np.dot(A, B)" ] }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[2. 3. 4.]\n" - ] - } - ], + "outputs": [], "source": [ "import numpy as np\n", "\n", @@ -1477,18 +1368,9 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[[1 2]\n", - " [3 4]]\n" - ] - } - ], + "outputs": [], "source": [ "a = np.array([[1, 2], [3, 4]])\n", "print(a)" @@ -1496,18 +1378,9 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[[1 2]\n", - " [3 4]]\n" - ] - } - ], + "outputs": [], "source": [ "b = np.array([[1, 2], [3, 4]])\n", "print(b)" @@ -1515,42 +1388,18 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[ 1, 4],\n", - " [ 9, 16]])" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "a * b" ] }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[ 7, 10],\n", - " [15, 22]])" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "np.dot(a,b)" ] @@ -1564,21 +1413,9 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[5., 5.],\n", - " [5., 5.]])" - ] - }, - "execution_count": 25, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "a = np.zeros((2, 2), dtype='float')\n", "a += 5\n", @@ -1587,21 +1424,9 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[25., 25.],\n", - " [25., 25.]])" - ] - }, - "execution_count": 26, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "a *= 5\n", "a" @@ -1609,21 +1434,9 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[50., 50.],\n", - " [50., 50.]])" - ] - }, - "execution_count": 27, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "a + a" ] @@ -1637,20 +1450,9 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([1, 2, 3, 4, 5, 6, 7, 8, 9])" - ] - }, - "execution_count": 28, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "a = np.array([1, 2, 3])\n", "b = np.array([4, 5, 6])\n", @@ -1660,22 +1462,9 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[1, 2, 3],\n", - " [4, 5, 6],\n", - " [7, 8, 9]])" - ] - }, - "execution_count": 29, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "np.vstack([a, b, c])" ] @@ -1689,20 +1478,9 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([3.14159265, 4.44288294, 5.44139809, 6.28318531])" - ] - }, - "execution_count": 30, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "x = np.arange(1, 5)\n", "np.sqrt(x) * np.pi" @@ -1710,80 +1488,36 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "16" - ] - }, - "execution_count": 31, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "2**4" ] }, { "cell_type": "code", - "execution_count": 32, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "16" - ] - }, - "execution_count": 32, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "np.power(2, 4)" ] }, { "cell_type": "code", - "execution_count": 33, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "1.0" - ] - }, - "execution_count": 33, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "np.log(np.e)" ] }, { "cell_type": "code", - "execution_count": 34, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "4" - ] - }, - "execution_count": 34, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "x = np.arange(5)\n", "x.max() - x.min()" @@ -1805,20 +1539,9 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([2, 3])" - ] - }, - "execution_count": 35, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "a = np.arange(10)\n", "a[2:4]" @@ -1826,40 +1549,18 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([0, 2, 4, 6, 8])" - ] - }, - "execution_count": 36, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "a[:10:2]" ] }, { "cell_type": "code", - "execution_count": 37, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([9, 8, 7, 6, 5, 4, 3, 2, 1, 0])" - ] - }, - "execution_count": 37, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "a[::-1]" ] @@ -1873,22 +1574,9 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[ 0, 1, 2, 3],\n", - " [ 4, 5, 6, 7],\n", - " [ 8, 9, 10, 11]])" - ] - }, - "execution_count": 38, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "x = np.arange(12).reshape(3, 4)\n", "x" @@ -1896,81 +1584,36 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "11" - ] - }, - "execution_count": 39, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "x[2, 3]" ] }, { "cell_type": "code", - "execution_count": 40, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([1, 5, 9])" - ] - }, - "execution_count": 40, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "x[:, 1]" ] }, { "cell_type": "code", - "execution_count": 41, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([4, 5, 6, 7])" - ] - }, - "execution_count": 41, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "x[1, :]" ] }, { "cell_type": "code", - "execution_count": 42, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[ 4, 5, 6, 7],\n", - " [ 8, 9, 10, 11]])" - ] - }, - "execution_count": 42, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "x[1:3, :]" ] @@ -1991,20 +1634,9 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([2, 2, 2, 3, 3, 3])" - ] - }, - "execution_count": 43, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "a = np.array([1, 1, 1, 2, 2, 2, 3, 3, 3])\n", "a[a > 1]" @@ -2012,80 +1644,36 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([3, 3, 3])" - ] - }, - "execution_count": 44, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "a[a == 3]" ] }, { "cell_type": "code", - "execution_count": 45, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "(array([0, 1, 2, 3, 4, 5], dtype=int64),)" - ] - }, - "execution_count": 45, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "np.where(a < 3)" ] }, { "cell_type": "code", - "execution_count": 46, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([0, 1, 2, 3, 4, 5], dtype=int64)" - ] - }, - "execution_count": 46, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "np.where(a < 3)[0]" ] }, { "cell_type": "code", - "execution_count": 47, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "(array([], dtype=int64),)" - ] - }, - "execution_count": 47, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "np.where(a > 9)" ] @@ -2099,18 +1687,9 @@ }, { "cell_type": "code", - "execution_count": 48, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "ename": "SyntaxError", - "evalue": "Missing parentheses in call to 'print'. Did you mean print(row)? (, line 2)", - "output_type": "error", - "traceback": [ - "\u001b[1;36m File \u001b[1;32m\"\"\u001b[1;36m, line \u001b[1;32m2\u001b[0m\n\u001b[1;33m print row\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m Missing parentheses in call to 'print'. Did you mean print(row)?\n" - ] - } - ], + "outputs": [], "source": [ "for row in x:\n", " print row"