Skip to content

DEP: Check integer array indices when result/subspace is empty #15898

@seberg

Description

@seberg

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 :))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions