From 5fd2adfe5b454d1395a5d1402a7cf0487365bf36 Mon Sep 17 00:00:00 2001 From: Anna Sosnovske Date: Mon, 9 Feb 2026 13:23:27 -0700 Subject: [PATCH] Completed NumPy Module 2 Exercises --- Introduction-to-Python | 1 + NumPy/2. Create an Array.ipynb | 42 ++++++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 7 deletions(-) create mode 160000 Introduction-to-Python diff --git a/Introduction-to-Python b/Introduction-to-Python new file mode 160000 index 0000000..eda4e59 --- /dev/null +++ b/Introduction-to-Python @@ -0,0 +1 @@ +Subproject commit eda4e59af2fe84c073f3b35d84674b6cd9aa7a68 diff --git a/NumPy/2. Create an Array.ipynb b/NumPy/2. Create an Array.ipynb index 8cd63b0..64529f6 100644 --- a/NumPy/2. Create an Array.ipynb +++ b/NumPy/2. Create an Array.ipynb @@ -697,10 +697,26 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "24\n", + "1000\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "t=(10,20,30)\n", + "arr_tuple = np.array(t)\n", + "arr_range = np.arange(1000, dtype=np.int8)\n", + "print(arr_tuple.nbytes)\n", + "print(arr_range.nbytes)\n" + ] }, { "cell_type": "markdown", @@ -722,10 +738,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['Kesler Peak' '10420' 'Kings Peak' 'Lone Peak']\n" + ] + } + ], + "source": [ + "arr = np.array([\"Superior\", \"10420\", \"Kings Peak\", \"Lone Peak\"], dtype='U15')\n", + "arr[0] = \"Kesler Peak\"\n", + "print(arr)" + ] }, { "cell_type": "markdown", @@ -744,7 +772,7 @@ ], "metadata": { "kernelspec": { - "display_name": "p310env", + "display_name": "Python 3", "language": "python", "name": "python3" },