From bb75908dd68e76f25338493e593b89a33efca49c Mon Sep 17 00:00:00 2001 From: Afonso Date: Thu, 20 Apr 2023 23:49:27 +0100 Subject: [PATCH] Did what I could --- your-code/main.ipynb | 111 ++++++++++++++++++++++++++++++++----------- 1 file changed, 83 insertions(+), 28 deletions(-) diff --git a/your-code/main.ipynb b/your-code/main.ipynb index e66d6ce..e8a1676 100644 --- a/your-code/main.ipynb +++ b/your-code/main.ipynb @@ -12,11 +12,11 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ - "# your code here" + "import numpy as np" ] }, { @@ -28,11 +28,19 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1.21.5\n" + ] + } + ], "source": [ - "# your code here" + "print(np.version.version)" ] }, { @@ -45,25 +53,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ - "# Method 1" + "a = np.random.rand(2, 3, 5)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ - "# Method 2" + "a = np.random.random(size = (2,3,5))" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -79,11 +87,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[[0.77738968 0.81358654 0.59389129 0.41128853 0.4003469 ]\n", + " [0.28666783 0.69644406 0.41998219 0.22159706 0.56501835]\n", + " [0.73808005 0.1297112 0.58609809 0.76265974 0.96834767]]\n", + "\n", + " [[0.24315664 0.0784898 0.89210882 0.1600817 0.10215783]\n", + " [0.21953937 0.25606114 0.53067651 0.62760852 0.46673056]\n", + " [0.96037707 0.95224151 0.26605448 0.95009055 0.09361499]]]\n" + ] + } + ], "source": [ - "# your code here" + "print(a)" ] }, { @@ -95,11 +117,11 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ - "# your code here" + "b = np.ones((5,2,3))" ] }, { @@ -111,11 +133,32 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# your code here" + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[[1. 1. 1.]\n", + " [1. 1. 1.]]\n", + "\n", + " [[1. 1. 1.]\n", + " [1. 1. 1.]]\n", + "\n", + " [[1. 1. 1.]\n", + " [1. 1. 1.]]\n", + "\n", + " [[1. 1. 1.]\n", + " [1. 1. 1.]]\n", + "\n", + " [[1. 1. 1.]\n", + " [1. 1. 1.]]]\n" + ] + } + ], + "source": [ + "print(b)" ] }, { @@ -127,11 +170,23 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# your code here" + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(2, 3, 5)\n", + "(5, 2, 3)\n" + ] + } + ], + "source": [ + "# a and b do not have the same size. a has 2 arrays, with 3 rows each and 5 columns. b has 5 arrays, with 2 rows each and 3 columns.\n", + "\n", + "print(a.shape)\n", + "print(b.shape)" ] }, { @@ -163,7 +218,7 @@ "metadata": {}, "outputs": [], "source": [ - "# your code here" + "# your answer here" ] }, { @@ -345,7 +400,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -359,7 +414,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.2" + "version": "3.9.13" } }, "nbformat": 4,