-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Closed
Labels
Description
The np.ma.count and np.ma.copy behave strangly if the input is a list or tuple (probably also other python builtins).
>>> np.ma.copy([1,2,3]) # unexpected behaviour
[1, 2, 3]
>>> np.copy([1,2,3]) # expected behaviour
array([1, 2, 3])
>>> np.ma.count([1,2,3])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Programming\Anaconda\envs\test\lib\site-packages\numpy\ma\core.py", line 6389, in __call__
return method(*args, **params)
TypeError: count() takes exactly one argument (0 given)
The reason for this behaviour is that list has a count and copy method and np.ma._frommethod tries to call it instead of np.ma.MaskedArray.count (and copy).
Reactions are currently unavailable