[Numpy-discussion] feedback request: proposal to add masks to the core ndarray
Olivier Delalleau
shish at keba.be
Sat Jun 25 11:12:49 EDT 2011
2011/6/25 Charles R Harris <charlesr.harris at gmail.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.
>
> Chuck
>
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
container.
The one thing that is annoying with NaN is that NaN != NaN. It makes code
involving comparisons quite ugly.
-=- Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110625/ba48c636/attachment.html>
More information about the NumPy-Discussion
mailing list