diff options
author | Allan Haldane <ealloc@gmail.com> | 2019-03-27 09:30:04 -0400 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2019-03-27 14:30:04 +0100 |
commit | e6147b9bf580361f2f74ac72003f81e957587528 (patch) | |
tree | 7829f02196df4c91f87d53410a3c57c89be2c13e /numpy/core/fromnumeric.py | |
parent | d6dcaedad22f5842e28179351238b4847e74d5a9 (diff) | |
download | numpy-e6147b9bf580361f2f74ac72003f81e957587528.tar.gz |
MAINT: add overlap checks to choose, take, put, putmask (#13182)
Fixes #9293, #6272
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 760577890..cb10c3947 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -130,7 +130,8 @@ def take(a, indices, axis=None, out=None, mode='raise'): input array is used. out : ndarray, optional (Ni..., Nj..., Nk...) If provided, the result will be placed in this array. It should - be of the appropriate shape and dtype. + be of the appropriate shape and dtype. Note that `out` is always + buffered if `mode='raise'`; use other modes for better performance. mode : {'raise', 'wrap', 'clip'}, optional Specifies how out-of-bounds indices will behave. @@ -355,7 +356,8 @@ def choose(a, choices, out=None, mode='raise'): ``choices.shape[0]``) is taken as defining the "sequence". out : array, optional If provided, the result will be inserted into this array. It should - be of the appropriate shape and dtype. + be of the appropriate shape and dtype. Note that `out` is always + buffered if `mode='raise'`; use other modes for better performance. mode : {'raise' (default), 'wrap', 'clip'}, optional Specifies how indices outside `[0, n-1]` will be treated: @@ -512,7 +514,8 @@ def put(a, ind, v, mode='raise'): 'clip' mode means that all indices that are too large are replaced by the index that addresses the last element along that axis. Note - that this disables indexing with negative numbers. + that this disables indexing with negative numbers. In 'raise' mode, + if an exception occurs the target array may still be modified. See Also -------- |