Merge pull request #74 from ncclementi/patch-1
Fix typo in 02.06-Boolean-Arrays-and-Maskspull/78/head
commit
de0cc6bd31
|
@ -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)"
|
||||
]
|
||||
},
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue