Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Introduction-to-Python
Submodule Introduction-to-Python added at eda4e5
42 changes: 35 additions & 7 deletions NumPy/2. Create an Array.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -744,7 +772,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "p310env",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand Down