Merge pull request #74 from ncclementi/patch-1

Fix typo in 02.06-Boolean-Arrays-and-Masks
pull/78/head
Jake Vanderplas 2017-06-28 07:14:04 -07:00 committed by GitHub
commit de0cc6bd31
2 changed files with 2 additions and 2 deletions

View File

@ -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)"
]
},

View File

@ -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",