diff options
Diffstat (limited to 'numpy/doc/indexing.py')
-rw-r--r-- | numpy/doc/indexing.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/doc/indexing.py b/numpy/doc/indexing.py index 39b2c73ed..f80d6c29e 100644 --- a/numpy/doc/indexing.py +++ b/numpy/doc/indexing.py @@ -93,7 +93,9 @@ well. A few examples illustrates best: :: [21, 24, 27]]) Note that slices of arrays do not copy the internal array data but -also produce new views of the original data. +only produce new views of the original data. This is different from +list or tuple slicing and an explicit ``copy()`` is recommended if +the original data is not required anymore. It is possible to index arrays with other arrays for the purposes of selecting lists of values out of arrays into new arrays. There are @@ -240,7 +242,7 @@ The result will be multidimensional if y has more dimensions than b. For example: :: >>> b[:,5] # use a 1-D boolean whose first dim agrees with the first dim of y - array([False, False, False, True, True], dtype=bool) + array([False, False, False, True, True]) >>> y[b[:,5]] array([[21, 22, 23, 24, 25, 26, 27], [28, 29, 30, 31, 32, 33, 34]]) @@ -422,7 +424,7 @@ object: :: [37, 40, 43], [46, 49, 52]]) -For this reason it is possible to use the output from the np.where() +For this reason it is possible to use the output from the np.nonzero() function directly as an index since it always returns a tuple of index arrays. |