You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 listhas a count and copy method and np.ma._frommethod tries to call it instead of np.ma.MaskedArray.count (and copy).
Activity
BUG: Look up methods on MaskedArray in _frommethod
BUG: Look up methods on MaskedArray in _frommethod