If not so, how can I return a set of False values if my masking condition is not met?
Ciao Gökhan,
AFAIR, shrink is used only to force a collapse of a mask full of False, not to force the creation of such a mask.
Now, it should work as you expected, meaning that it needs to be fixed. Could you open a ticket? And put me in copy, just in case.
Anyhow:
Your trick is a tad dangerous, as it erases the previous mask. I'd prefer to create x w/ a full mask, then use masked_values w/ shrink=False... Now, if you're sure there's no masked values, go for it.
Cheers
_______________________________________________
NumPy-Discussion mailing list
NumPy-Di...@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Ciao Gökhan,
AFAIR, shrink is used only to force a collapse of a mask full of False, not to force the creation of such a mask.
Now, it should work as you expected, meaning that it needs to be fixed. Could you open a ticket? And put me in copy, just in case.
Anyhow:
Your trick is a tad dangerous, as it erases the previous mask. I'd prefer to create x w/ a full mask, then use masked_values w/ shrink=False... Now, if you're sure there's x= no masked values, go for it.
Cheers
In practice, np.ma.nomask lets us quickly check whether a MaskedArray
has a masked value : if its .mask is np.ma.nomask, then no masked
value, otherwise it's a full boolean array and we can use any.
If you want to create a MaskedArray w/ a full boolean mask, just use::
np.ma.array(..., mask=False)
In that case, the mask is automatically created as a boolean array
with the same shape as the data, with False everywhere. If you used
True, the mask would be full of True...
Now, just to be clear, you'd want
'np.ma.masked_values(...,shrink=False) to create a maked array w/ a
full boolean mask by default, right ?
> Now, just to be clear, you'd want
> 'np.ma.masked_values(...,shrink=False) to create a maked array w/ a
> full boolean mask by default, right ?