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
This is essentially a re-opening of #6844 with examples:
importnumpyasnpprint(np.__version__) # 1.11.1x=np.ma.arange(24)
x.shape= (4, 3, 2)
# e.g. this worksprint(np.ma.mean(x, axis=(0,1))) # [11.0 12.0]# but it doesn't work with a mask array setx.mask=x.data>12
Testing with version 1.11.1, here are the methods that raise TypeError: tuple indices must be integers, not tuple:
np.ma.mean(x, axis=(0,1))
np.ma.std(x, axis=(0, 1))
np.ma.var(x, axis=(0, 1))
This raises a variation TypeError: an integer is required for the axis:
np.ma.median(x, axis=(0, 1))
And these methods appear to work, returning a masked array result:
np.ma.min(x, axis=(0, 1)) # [0 1]
np.ma.max(x, axis=(0, 1)) # [12 11]
np.ma.sum(x, axis=(0, 1)) # [42 36]
(are there other operators with a mask= argument?)
I get the same results with NumPy 1.11.1 with Python 2.7 on Windows and Linux.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
This is essentially a re-opening of #6844 with examples:
Testing with version 1.11.1, here are the methods that raise
TypeError: tuple indices must be integers, not tuple
:np.ma.mean(x, axis=(0,1))
np.ma.std(x, axis=(0, 1))
np.ma.var(x, axis=(0, 1))
This raises a variation
TypeError: an integer is required for the axis
:np.ma.median(x, axis=(0, 1))
And these methods appear to work, returning a masked array result:
np.ma.min(x, axis=(0, 1))
# [0 1]np.ma.max(x, axis=(0, 1))
# [12 11]np.ma.sum(x, axis=(0, 1))
# [42 36](are there other operators with a
mask=
argument?)I get the same results with NumPy 1.11.1 with Python 2.7 on Windows and Linux.
The text was updated successfully, but these errors were encountered: