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
If I mask an array, I would expect that its lenght is equal to the number of not-masked elements, or at least I would like to have a function to retrieve such information.
>>> import numpy
>>> m = numpy.ma.masked_equal([1, 2, None, 3, None, None, 4], None)
I would expect len(m) to be 4
>>> len(m)
7
There is not an alternative function as for average, var, for masked arrays:
>>> numpy.ma.average(m)
2
>>> numpy.average(m)
TypeError
>>> numpy.ma.len(m)
Function doesn't exists
The text was updated successfully, but these errors were encountered:
Original ticket http://projects.scipy.org/numpy/ticket/1181 on 2009-07-23 by @dalloliogm, assigned to unknown.
What should len() of a masked array return?
If I mask an array, I would expect that its lenght is equal to the number of not-masked elements, or at least I would like to have a function to retrieve such information.
The text was updated successfully, but these errors were encountered: