diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2020-03-22 19:57:47 +0000 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2020-03-22 20:29:49 +0000 |
commit | 849756ff1582ad46d14b7ff621a6e524337304f9 (patch) | |
tree | cfe84a81da89e3fe16d78c6e19a839513bee2c35 /numpy/lib/function_base.py | |
parent | 90e644e7c668d52155e9a07b1032e71974e3dc7d (diff) | |
download | numpy-849756ff1582ad46d14b7ff621a6e524337304f9.tar.gz |
DEP: Forbid passing non-integral index arrays to `insert` and `delete`
This expires a deprecation warning from back in 1.9.
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 1c67f7c99..d39ee63b6 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -4369,14 +4369,6 @@ def delete(arr, obj, axis=None): else: if obj.size == 0 and not isinstance(_obj, np.ndarray): obj = obj.astype(intp) - if not np.can_cast(obj, intp, 'same_kind'): - # obj.size = 1 special case always failed and would just - # give superfluous warnings. - # 2013-09-24, 1.9 - warnings.warn( - "using a non-integer array as obj in delete will result in an " - "error in the future", DeprecationWarning, stacklevel=3) - obj = obj.astype(intp) keep = ones(N, dtype=bool) # Test if there are out of bound indices, this is deprecated @@ -4590,13 +4582,6 @@ def insert(arr, obj, values, axis=None): # Can safely cast the empty list to intp indices = indices.astype(intp) - if not np.can_cast(indices, intp, 'same_kind'): - # 2013-09-24, 1.9 - warnings.warn( - "using a non-integer array as obj in insert will result in an " - "error in the future", DeprecationWarning, stacklevel=3) - indices = indices.astype(intp) - indices[indices < 0] += N numnew = len(indices) |