diff options
author | Ori Broda <ori.broda@mail.huji.ac.il> | 2019-05-25 04:29:52 +0300 |
---|---|---|
committer | Ori Broda <ori.broda@mail.huji.ac.il> | 2019-05-25 04:29:52 +0300 |
commit | 50e477e0140f203c1f9926ef8adfae9b4ed499ca (patch) | |
tree | fd6d3a33b052f1395b934690290462bcd38a433a /numpy/doc/indexing.py | |
parent | 9713e86cc65ebed96464f4d81bb2637857b84f44 (diff) | |
download | numpy-50e477e0140f203c1f9926ef8adfae9b4ed499ca.tar.gz |
DOC: Update boolean indices in index arrays with slices example
Diffstat (limited to 'numpy/doc/indexing.py')
-rw-r--r-- | numpy/doc/indexing.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/doc/indexing.py b/numpy/doc/indexing.py index f80d6c29e..b752582c2 100644 --- a/numpy/doc/indexing.py +++ b/numpy/doc/indexing.py @@ -295,6 +295,13 @@ to produce a resultant array of shape (3,2). Likewise, slicing can be combined with broadcasted boolean indices: :: + >>> b = y > 20 + >>> b + array([[False, False, False, False, False, False, False], + [False, False, False, False, False, False, False], + [False, False, False, False, False, False, False], + [ True, True, True, True, True, True, True], + [ True, True, True, True, True, True, True]]) >>> y[b[:,5],1:3] array([[22, 23], [29, 30]]) |