[Numpy-discussion] Proper NaN handling in max and co: a redux
Charles R Harris
Thu Sep 25 23:53:53 CDT 2008
On Thu, Sep 25, 2008 at 10:15 PM, David Cournapeau <
> 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:
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion