<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 30, 2013 at 7:05 PM, Ondřej Čertík <span dir="ltr"><<a href="mailto:ondrej.certik@gmail.com" target="_blank">ondrej.certik@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
What is the rationale for using False in 'mask' for elements that<br>
should be included?<br>
<br>
<a href="http://docs.scipy.org/doc/numpy/reference/maskedarray.generic.html" target="_blank">http://docs.scipy.org/doc/numpy/reference/maskedarray.generic.html</a><br>
<br>
As opposed to using True for elements that should be included, which<br>
is what I was intuitively expecting when I started using the masked<br>
arrays. This "True convention" also happens to be the one used in<br>
Fortran, see e.g.:<br>
<br>
<a href="http://gcc.gnu.org/onlinedocs/gfortran/SUM.html" target="_blank">http://gcc.gnu.org/onlinedocs/gfortran/SUM.html</a><br>
<br>
So it's confusing why NumPy would chose a "False convention". Could it<br>
be, that NumPy views 'mask' as opacity? Then it would make sense to<br>
use True to make a value 'opaque'.<br></blockquote><div><br></div><div>There was a lengthy discussion of this point back when the NA work was done. You might be able to find the thread with a search.<br><br></div>
<div>As to why it is as it is, I suspect it is historical consistency. Pierre wrote the masked array package for numpy, but it may very well go back to the masked array package implemented for Numeric.<br></div><div><br></div>
<div>Chuck <br></div><br></div></div></div>