diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2020-03-23 10:12:07 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-23 10:12:07 -0500 |
commit | d5010b129e4f3714dcad04eb7115372848fbce36 (patch) | |
tree | c1db6f57913f97d2896024c9ce838f520f1e90e4 /numpy/lib/function_base.py | |
parent | 9ae4a0d1ebc52a556ed13248172e8280ad9fc6bd (diff) | |
parent | 68563e997aab1208c71efec5698c24214d840cda (diff) | |
download | numpy-d5010b129e4f3714dcad04eb7115372848fbce36.tar.gz |
Merge pull request #15804 from eric-wieser/expire-delete-out-of-bounds
DEP: Make np.delete on out-of-bounds indices an error
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index d39ee63b6..a49c34741 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -4371,23 +4371,6 @@ def delete(arr, obj, axis=None): obj = obj.astype(intp) keep = ones(N, dtype=bool) - # Test if there are out of bound indices, this is deprecated - inside_bounds = (obj < N) & (obj >= -N) - if not inside_bounds.all(): - # 2013-09-24, NumPy 1.9 - warnings.warn( - "in the future out of bounds indices will raise an error " - "instead of being ignored by `numpy.delete`.", - DeprecationWarning, stacklevel=3) - obj = obj[inside_bounds] - positive_indices = obj >= 0 - if not positive_indices.all(): - # 2013-04-11, NumPy 1.8 - warnings.warn( - "in the future negative indices will not be ignored by " - "`numpy.delete`.", FutureWarning, stacklevel=3) - obj = obj[positive_indices] - keep[obj, ] = False slobj[axis] = keep new = arr[tuple(slobj)] |