On Tue, Oct 1, 2013 at 3:57 AM, Ondřej Čertík <ondrej.cer...@gmail.com>
wrote:

> I see, that makes sense. So to remember this, the rule is:
>
> "Specify elements that you want to get masked using True in 'mask'".

Yes. This convention dates back at least to the original MA package in
Numeric; I don't know if Paul Dubois stole it from any previous software.

One way to motivate the convention is to think about doing a binary
operation on masked arrays, which is really the most common kind of thing
one does with masked arrays. The mask of the result is the logical OR of
the two operand masks (barring additional masked elements from domain
violations, 0/0, etc.). I assume that the convention was decided mostly on
what was most convenient and efficient for the common internal operations
for *implementing* the masked arrays and not necessarily matching any
particular intuitions when putting data *into* the masked arrays.

--
Robert Kern
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to