-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Closed
Description
The any
function seems to not deal well for arrays of dtype object
. According to the documentation it should return a boolean. However, consider the following code:
print(numpy.array([5, None]).any())
To my surprise, this prints 5
, rather than True
. It seems to always return the first element of which the boolean value is True
, or, if no such elements exist, the last element. (This means that numpy.array([False, None]).any()
evaluates to None
.)
Appears to happen in Python 3.6.1, Numpy 1.12.1, on Linux, as well as Python 2.7.10, numpy 1.9.2. on Windows (10).
Metadata
Metadata
Assignees
Labels
No labels