-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
DEP: Check integer array indices when result/subspace is empty #15898
Copy link
Copy link
Closed
Description
Quote from @jbrockmendel
This matches the numpy behavior:
arr = np.array([]).reshape(0, 0)
nd3 = np.random.randint(5, size=(2, 2, 2))
arr[nd3] = 0
This may be a numpy bug as well cc @seberg ?
The above should validate the integer index and raise an error due to out of bound values. I am aware that there are issues with this when there are multiple array-indices which have an empty broadcast shape. But, I am not (at least anymore) aware of it when the slicing "subspace" is empty as opposed to the "advanced indexing" part being empty, and we should probably fix that.
(had to put the subspace word, it used to be a running gag with Jaime :))
Reactions are currently unavailable