-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Closed
Description
Related to #4353, #4980, but would like to ask the cases when the indexer is a single bool.
-
In normal array,
bool
looks coerces toint
. Is this intended, or should be regarded as a boolean indexing with different shape (DEP: Deprecate boolean array indices with non-matching shape #4353)?np.__version__ # '1.9.2' np.array([0])[True] # IndexError: index 1 is out of bounds for axis 0 with size 1 np.array([0])[False] #0
-
0-dim array behaves quite strangely. I understand this should raise
IndexError
if it coerces toint
.np.array(0)[False] # array([], dtype=int64) np.array(0)[True] # array([0]) np.array(0)[0] # IndexError: too many indices for array
Metadata
Metadata
Assignees
Labels
No labels