[Numpy-discussion] feedback request: proposal to add masks to the core ndarray
Charles R Harris
Thu Jun 23 16:46:30 CDT 2011
On Thu, Jun 23, 2011 at 2:53 PM, Mark Wiebe <email@example.com> wrote:
> Enthought has asked me to look into the "missing data" problem and how
> NumPy could treat it better. I've considered the different ideas of adding
> dtype variants with a special signal value and masked arrays, and concluded
> that adding masks to the core ndarray appears is the best way to deal with
> the problem in general.
> I've written a NEP that proposes a particular design, viewable here:
> There are some questions at the bottom of the NEP which definitely need
> discussion to find the best design choices. Please read, and let me know of
> all the errors and gaps you find in the document.
I agree that low level support for masks is the way to go.
> If all the input values are masked, 'sum' and 'prod' will produce the
additive and multiplicative identities respectively
A masked zero dimensional array might be another option, depending on how
you handle scalars. This would also work when arrays were summed down an
axis if a masked array was returned.
I suppose the problem with using the word 'mask' is the implication that it
hides something. Maybe 'window' would be an alternate choice, although in
this context I tend to think of 'mask' as having the meaning you assign to
> NumPy-Discussion mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion