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

Pierre GM pgmdevlist@gmail....
Fri Sep 26 10:47:18 CDT 2008

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 the nans at one end or the other and sort the remainder. That
> would also make it easy to raise an error if we wanted to and avoid an
> extra compare in all the other sorting passes. That approach could probably
> be extended to masked arrays also.

Note that MaskedArray.sort has already an extra keyword 'end_with', that lets 
you decide whether missing data should be at the beginning or the end of  the 

More information about the Numpy-discussion mailing list