[Numpy-discussion] Proper NaN handling in max and co: a redux

Charles R Harris charlesr.harris at gmail.com
Fri Sep 26 00:53:53 EDT 2008


On Thu, Sep 25, 2008 at 10:15 PM, David Cournapeau <
david at ar.media.kyoto-u.ac.jp> wrote:

> Hi,
>
>    We started a small document to gather all information given in
> previous threads about NaN handling in max and co in numpy. Thanks to
> Anne (Archibald) for useful comments/additions/typo corrections:
>
> http://projects.scipy.org/scipy/numpy/wiki/ProperNanHandling
>
> We describe approaches taken by R and matlab for the relevant functions,
> and possible approaches to take in numpy. I have an patch almost ready
> (with tests) for the approach "Returning NaN" (Chuck said he would be
> willing to implement the sort/argsort part, which is the part missing in
> my current implementation).
>
> I think it would be nice for 1.3.0,
>

I'm also wondering about the sign ufunc. It should probably return nan for
nans, but -1,0,1 are the current values. We also need to decide which end of
the sorted values the nans should go to. I'm a bit partial to the beginning
but the end would be fine with me, it might even be a bit more natural as
searchsorted would find the beginning of the nans by default.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080925/0468d3c2/attachment.html>


More information about the NumPy-Discussion mailing list