Skip to content

Commit a86d2d9

Browse files
author
craigsdennis
committed
Adds creation and indexing reflection notes
1 parent be347ea commit a86d2d9

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

Introduction to NumPy.ipynb

+17-5
Original file line numberDiff line numberDiff line change
@@ -632,15 +632,27 @@
632632
"cell_type": "markdown",
633633
"metadata": {},
634634
"source": [
635-
"## Creation\n",
636-
"* Random state\n",
637-
"* Appending rows\n",
635+
"## Creation \n",
636+
"* You can create a random but bound grouping of values using the `np.random` package. \n",
637+
" * `RandomState` let's you seed your randomness in a way that is repeatable.\n",
638+
"* You can append a row in a couple of ways\n",
639+
" * You can use the `np.append` method. Make sure the new row is the same shape.\n",
640+
" * You can create/reassign a new array by including the existing array as part of the iterable in creation.\n",
641+
"\n",
638642
"\n",
639643
"## Indexing\n",
640-
"* Shortcut (tuple)\n",
641-
"* Fancy Indexing"
644+
"* You can use an indexing shortcut by separating dimensions with a comma. \n",
645+
"* You can index using a `list` or `np.array`. Values will be pulled out at that specific index. This is known as fancy indexing.\n",
646+
" * Resulting array shape matches the index array layout. Be careful to distinguish between the tuple shortcut and fancy indexing."
642647
]
643648
},
649+
{
650+
"cell_type": "code",
651+
"execution_count": null,
652+
"metadata": {},
653+
"outputs": [],
654+
"source": []
655+
},
644656
{
645657
"cell_type": "code",
646658
"execution_count": 33,

0 commit comments

Comments
 (0)