diff options
author | Matti Picus <matti.picus@gmail.com> | 2020-05-28 00:19:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-28 00:19:05 +0300 |
commit | 671804035cda35211f97f6cf9f80d16152a872fd (patch) | |
tree | bf1d29ecffdeb26a15221322a08e140b639f3869 /doc | |
parent | 4262a9c717a1504d0548d74c3276e296b04a8826 (diff) | |
parent | 381a2f5ab22bf1b84870ec4dfb1ee04327faf918 (diff) | |
download | numpy-671804035cda35211f97f6cf9f80d16152a872fd.tar.gz |
Merge pull request #15900 from seberg/deprecate-empty-indexing-error
DEP: Ensure indexing errors will be raised even on empty results
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/upcoming_changes/15900.deprecation.rst | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/release/upcoming_changes/15900.deprecation.rst b/doc/release/upcoming_changes/15900.deprecation.rst new file mode 100644 index 000000000..22be711d0 --- /dev/null +++ b/doc/release/upcoming_changes/15900.deprecation.rst @@ -0,0 +1,16 @@ +Indexing errors will be reported even when index result is empty +---------------------------------------------------------------- +In the future, NumPy will raise an IndexError when an +integer array index contains out of bound values even if a non-indexed +dimension is of length 0. This will now emit a DeprecationWarning. +This can happen when the array is previously empty, or an empty +slice is involved:: + + arr1 = np.zeros((5, 0)) + arr1[[20]] + arr2 = np.zeros((5, 5)) + arr2[[20], :0] + +Previously the non-empty index ``[20]`` was not checked for correctness. +It will now be checked causing a deprecation warning which will be turned +into an error. This also applies to assignments. |