[Numpy-discussion] feedback request: proposal to add masks to the core ndarray

Benjamin Root ben.root@ou....
Sat Jun 25 14:44:12 CDT 2011

On Sat, Jun 25, 2011 at 9:21 AM, Charles R Harris <charlesr.harris@gmail.com
> wrote:

> I think he aims to support both. One complication with masks is keeping
> them tied to the data on disk. With na values one file can contain both the
> data and the missing data markers, whereas with masks, two files would be
> required. I don't think that will fly in the long run unless there is some
> standard file format, like geotiff for GIS, that combines both.
> Chuck
I think you hit on a very important issue.  How do we save this data?  The
NA approach provides an inherent solution (although this does assume that
the magic value is known and agreed to because it is not recorded.
Meanwhile, masks are separate structures.

I have been so accustomed to simply creating masks on the fly that I never
bothered to save them (or I simply harden them with a fill value of NaNs or
whatnot).  As for a filetype that I use when I do want to save this
information, I typically use NetCDF with a "missing" attribute defined or
just use NaNs.  The scipy.io.netcdf module could be improved to look for a
"missing" attribute and set an appropriate NA value automatically,

Ben Root
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110625/ac6715e0/attachment.html 

More information about the NumPy-Discussion mailing list