diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-11-23 15:52:36 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2016-12-03 11:46:55 -0700 |
commit | b80bcee391cf0a9ae8a02b0217511370bb3c7681 (patch) | |
tree | 50987f2d62a164efc68deea2d452e85d68997edb /doc | |
parent | dc27edb92ec70b5c0ade8ecd1ed78884a0a0a5dc (diff) | |
download | numpy-b80bcee391cf0a9ae8a02b0217511370bb3c7681.tar.gz |
DEP: Drop deprecated boolean indexing behavior and update to new.
This affects mostly old boolean indexing behavior that was deprecated in
NumPy 1.9. At the time the new behavior was causing errors in a number
of downstream projects, hopefully that has been taken care of.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/1.13.0-notes.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/release/1.13.0-notes.rst b/doc/release/1.13.0-notes.rst index 51beffce3..d41b06c37 100644 --- a/doc/release/1.13.0-notes.rst +++ b/doc/release/1.13.0-notes.rst @@ -46,6 +46,7 @@ See Changes section for more detail. * ``subtract(bool_, bool_)``, TypeError when subtracting boolean from boolean. * ``np.equal, np.not_equal``, object identity doesn't override failed comparison. * ``np.equal, np.not_equal``, object identity doesn't override non-boolean comparison. +* Boolean indexing deprecated behavior dropped. See Changes below for details. FutureWarning to changed behavior ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -95,3 +96,19 @@ the effect of overriding comparison failures, comparison of objects that did not return booleans, such as np.arrays, and comparison of objects where the results differed from object identity, such as NaNs. +Boolean indexing changes +~~~~~~~~~~~~~~~~~~~~~~~~ +* Boolean array-likes (such as lists of python bools) are always treated as + boolean indexes. + +* Boolean scalars (including python ``True``) are legal boolean indexes and + never treated as integers. + +* Boolean indexes must match the dimension of the axis that they index. + +* Boolean indexes used on the lhs of an assigment must match the dimensions of + the rhs. + +* Boolean indexing into scalar arrays return a new 1-d array. This means that + ``array(1)[array(True)]`` gives ``array([1])`` and not the original array. + |