[Numpy-discussion] consensus (was: NA masks in the next numpy release?)
Sat Oct 29 17:47:30 CDT 2011
On 10/29/2011 12:02 PM, Olivier Delalleau wrote:
> I haven't been following the discussion closely, but wouldn't it be instead:
> a.mask[0:2] = True?
That would be consistent with numpy.ma and the opposite of Mark's
I can live with either, but I much prefer the numpy.ma version because
it fits with the use of bit-flags for editing data; set bit 1 if it
fails check A, set bit 2 if it fails check B, etc. So, if it evaluates
as True, there is a problem, and the value is masked *out*.
Similarly, in Marks implementation, 7 bits are available for a payload
to describe what kind of masking is meant. This seems more consistent
with True as masked (or NA) than with False as masked.
> It's something that I actually find a bit difficult to get right in the
> current numpy.ma <http://numpy.ma> implementation: I would find more
> intuitive to have True for "valid" data, and False for invalid / missing
> / ... I realize how the implementation makes sense (and is appropriate
> given that the name is "mask"), but I just thought I'd point this out...
> even if it's just me ;)
> -=- Olivier
> NumPy-Discussion mailing list
More information about the NumPy-Discussion