From: Sasha <nd...@ma...> - 2006-09-19 19:57:30
|
On 9/19/06, Tim Hochberg <tim...@ie...> wrote: > Ideally, -inf should sort first, inf should sort last and nan should > raise an exception if present. I disagree. NumPy sort leaving nan's where they are is probably just a side-effect of nans unusual properties (both nan<x and nan>x is always false), but it is a logical choice. Checking for nan will inevitably slow the most common use case. If you want an exception, just check isnan(x).any() before sort. |