[Numpy-discussion] MA bug or feature?

Paul Dubois pfdubois at gmail.com
Thu Jun 22 15:26:04 CDT 2006


Pierre wrote:


> I agree that's a bit confusing here, and there might be some room for
> improvement (for example, changing the current
> `if m is nomask` to `if m is nomask or m.any()==False`, or better, forcing
> mask to nomask if mask.any()==False). But I don;t think that qualifies as
> bug.


In the original MA in Numeric, I decided that to constantly check for masks
that didn't actually mask anything was not a good idea. It punishes normal
use with a very expensive check that is rarely going to be true.

If you are in a setting where you do not want this behavior, but instead
want masks removed whenever possible, you may wish to wrap or replace things
like masked_array so that they call make_mask with flag = 1:

y = masked_array(data, make_mask(maskdata, flag=1))

y will have no mask if maskdata is all false.

Thanks to Pierre for pointing out about masked_print_option.

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20060622/38228398/attachment-0001.html 


More information about the Numpy-discussion mailing list