-
-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Description
operator.index correctly raises an error on boolean arrays:
In [6]: operator.index(np.array(True))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-6-a4163d1794ac> in <module>()
----> 1 operator.index(np.array(True))
TypeError: only integer arrays with one element can be converted to an index
But on a boolean scalar, it incorrectly succeeds:
In [7]: operator.index(np.bool_(True))
Out[7]: 1
The latter should be an error (possibly with some deprecation period).
Metadata
Metadata
Assignees
Labels
No labels