[Numpy-discussion] consensus (was: NA masks in the next numpy release?)
Sat Oct 29 18:13:18 CDT 2011
On Sun, Oct 30, 2011 at 12:47 AM, Eric Firing <email@example.com> wrote:
> 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*.
I think in Mark's implementation it works the same:
>>> a = np.arange(3, maskna=True)
>>> a = np.NA
array([0, NA, 2])
array([False, True, False], dtype=bool)
This is more consistent than using False to represent an NA mask, I agree.
More information about the NumPy-Discussion