Skip to content
Merged
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
2 changes: 1 addition & 1 deletion notebooks/02.06-Boolean-Arrays-and-Masks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@
}
],
"source": [
"# are all values in each row less than 4?\n",
"# are all values in each row less than 8?\n",
"np.all(x < 8, axis=1)"
]
},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/02.07-Fancy-Indexing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"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",
"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",
"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",
"With this in mind, it is not the augmentation that happens multiple times, but the assignment, which leads to the rather nonintuitive results.\n",
"\n",
Expand Down