summaryrefslogtreecommitdiff
path: root/numpy/doc/indexing.py
diff options
context:
space:
mode:
authorGabor Kovacs <kgabor79@gmail.com>2014-08-23 17:50:10 +0100
committerCharles Harris <charlesr.harris@gmail.com>2015-06-21 15:44:25 -0600
commit4e5545f0bcc654fb0c6752dcf72120e6e7340d28 (patch)
tree83775e28968635ac9588c021280469599b0a520b /numpy/doc/indexing.py
parente3b2bc0b0f31482cd112660393245116ae55ecbf (diff)
downloadnumpy-4e5545f0bcc654fb0c6752dcf72120e6e7340d28.tar.gz
DOC: Update docs.
Update docs for boolean array indexing and nonzero order. Add links to row-major and column-major terms where they appear. Closes #3177
Diffstat (limited to 'numpy/doc/indexing.py')
-rw-r--r--numpy/doc/indexing.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/numpy/doc/indexing.py b/numpy/doc/indexing.py
index 0891e7c8d..9e9f0a10c 100644
--- a/numpy/doc/indexing.py
+++ b/numpy/doc/indexing.py
@@ -1,5 +1,4 @@
-"""
-==============
+"""==============
Array indexing
==============
@@ -229,10 +228,13 @@ most straightforward case, the boolean array has the same shape: ::
>>> y[b]
array([21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34])
-The result is a 1-D array containing all the elements in the indexed
-array corresponding to all the true elements in the boolean array. As
-with index arrays, what is returned is a copy of the data, not a view
-as one gets with slices.
+Unlike in the case of integer index arrays, in the boolean case, the
+result is a 1-D array containing all the elements in the indexed array
+corresponding to all the true elements in the boolean array. The
+elements in the indexed array are always iterated and returned in
+:term:`row-major` (C-style) order. The result is also identical to
+``y[np.nonzero(b)]``. As with index arrays, what is returned is a copy
+of the data, not a view as one gets with slices.
The result will be multidimensional if y has more dimensions than b.
For example: ::