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/1. Data Types.ipynb b/NumPy/1. Data Types.ipynb index f6feb84..5123b90 100644 --- a/NumPy/1. Data Types.ipynb +++ b/NumPy/1. Data Types.ipynb @@ -502,10 +502,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[260]\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "arr = np.array([250], dtype=np.int16)\n", + "arr.dtype\n", + "print(arr + 10)" + ] }, { "cell_type": "markdown", @@ -525,10 +538,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "8000000\n", + "2000000\n", + "4.0\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "arr = np.zeros([1000000], dtype=np.float64)\n", + "print(arr.nbytes)\n", + "arr2 = np.zeros([1000000], dtype=np.float16)\n", + "print(arr2.nbytes)\n", + "print(arr.nbytes / arr2.nbytes)" + ] }, { "cell_type": "markdown", @@ -550,21 +580,26 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "The data type of the array is