[Numpy-discussion] feedback request: proposal to add masks to the core ndarray
Sat Jun 25 10:12:49 CDT 2011
2011/6/25 Charles R Harris <email@example.com>
> I think what we really need to see are the use cases and work flow. The
> ones that hadn't occurred to me before were memory mapped files and data
> stored on disk in general. I think we may need some standard format for
> masked data on disk if we don't go the NA value route.
Sorry I can't follow closely this thread, but since use cases are mentioned,
I'll throw one. It may or may not already be supported by the current NEP, I
don't know. It may not be possible to support it either... anyway:
I typically use NaN to denote missing values in an array. The main
motivation vs. masks is my code typically involves multiple systems working
together, and not all of them are necessarily based on numpy. The nice thing
with NaN is it is preserved e.g. when I turn an array into a list, when I
write the data directly into a double* C array, etc. It's handy to
manipulate arrays with missing data without being constrained to a specific
The one thing that is annoying with NaN is that NaN != NaN. It makes code
involving comparisons quite ugly.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion