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

2008-09-26 Thread David Cournapeau
Anne Archibald wrote: > > I would think sign should return NaN (does it not now?) unless its > return type is integer, in which case I can't see a better answer than > raising an exception (we certainly don't want it silently swallowing > NaNs). > signbit (the C99 macro) returns an integer. So

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

2008-09-26 Thread Anne Archibald
2008/9/26 David Cournapeau <[EMAIL PROTECTED]>: > Charles R Harris wrote: >> >> 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

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

2008-09-26 Thread Pierre GM
On Friday 26 September 2008 08:29:02 Charles R Harris wrote: > It shouldn't be any more difficult to do either based on a keyword. > Argsorts shouldn't be a problem either. I'm thinking that the most flexible > way to handle the sorts is to make a preliminary pass through the data and > collect all

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

2008-09-26 Thread Charles R Harris
On Thu, Sep 25, 2008 at 10:56 PM, David Cournapeau < [EMAIL PROTECTED]> wrote: > Charles R Harris wrote: > > > > 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 nan

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

2008-09-25 Thread David Cournapeau
Charles R Harris wrote: > > 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

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

2008-09-25 Thread Charles R Harris
On Thu, Sep 25, 2008 at 10:15 PM, David Cournapeau < [EMAIL PROTECTED]> 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: > >

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

2008-09-25 Thread David Cournapeau
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