From: A. M. A. <per...@gm...> - 2006-09-19 20:01:55
|
On 19/09/06, Tim Hochberg <tim...@ie...> wrote: > Keith Goodman wrote: > > In what order would you like argsort to sort the values -inf, nan, inf? > > > Ideally, -inf should sort first, inf should sort last and nan should > raise an exception if present. > > -tim Mmm. Somebody who's working with NaNs has more or less already decided they don't want to be pestered with exceptions for invalid data. I'd be happy if they wound up at either end, but I'm not sure it's worth hacking up the sort algorithm when a simple isnan() can pull them out. What's happening now is that NaN<a, NaN==a, and NaN>a are all false, which rather confuses the sorting algorithm. But as long as it doesn't actually *break* (that is, leave some of the non-NaNs incorrectly sorted) I don't care. A. M. Archibald |