[Numpy-discussion] using NaN, INT_MIN etc in ndarray instead of a masked array

Michael Sorich michael.sorich at gmail.com
Mon Apr 17 17:13:09 EDT 2006


On 4/8/06, Sasha <ndarray at mac.com> wrote:
>
> ...
>
See above. For ndarray mask is always False unless an add-on module is
> loaded that redefines arithmetic to recognize special bit-patterns
> such as NaN or INT_MIN.
>
>
Is it possible to implement masked values using these special bit patterns
in the ndarray instead of using a separate MA class? If so has there been
any thought as to whether this may be the better option. I think it would be
preferable if the ability to handle masked data was available in the
standard array class (ndarray), as this would increase the likelihood that
functions built for numeric arrays will handle masked values well. It seems
that ndarray already has decent support for nans (isnan() returns the
equivalent of a boolean mask array), indicating that such an approach may be
acceptable. How difficult is it to generalise the concept to other data
types (int, string, bool)?

Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20060417/2cb1ca86/attachment.html>


More information about the NumPy-Discussion mailing list