Skip to content

Commit f3c57a2

Browse files
authored
Fix typo in 02.07-Fancy-Indexing
The second reference to `x[3]` in "You might expect that x[3] would contain the value 2, and x[3] would contain the value 3," should be x[4].
1 parent 0a4ba00 commit f3c57a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

notebooks/02.07-Fancy-Indexing.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@
709709
"cell_type": "markdown",
710710
"metadata": {},
711711
"source": [
712-
"You might expect that ``x[3]`` would contain the value 2, and ``x[3]`` would contain the value 3, as this is how many times each index is repeated. Why is this not the case?\n",
712+
"You might expect that ``x[3]`` would contain the value 2, and ``x[4]`` would contain the value 3, as this is how many times each index is repeated. Why is this not the case?\n",
713713
"Conceptually, this is because ``x[i] += 1`` is meant as a shorthand of ``x[i] = x[i] + 1``. ``x[i] + 1`` is evaluated, and then the result is assigned to the indices in x.\n",
714714
"With this in mind, it is not the augmentation that happens multiple times, but the assignment, which leads to the rather nonintuitive results.\n",
715715
"\n",

0 commit comments

Comments
 (0)