[Numpy-discussion] sorting -inf, nan, inf
Charles R Harris
charlesr.harris at gmail.com
Tue Sep 19 21:42:52 CDT 2006
On 9/19/06, A. M. Archibald <peridot.faceted at gmail.com> wrote:
> On 19/09/06, Tim Hochberg <tim.hochberg at ieee.org> wrote:
> > I'm still somewhat mystified by the desire to move the nans to one end
> > of the sorted object. I see two scenarios:
> It's mostly to have something to do with them other than throw an
> exception. Leaving them in place while the rest of the array is
> reshuffled requires a lot of work and isn't particularly better. I
> mostly presented it as an alternative to throwing an exception.
> Throwing a Python exception now seems like the most reasonable idea.
Well, mergesort can be adapted without a lot of work. Could be used to sort
masked arrays too, not that I know why anyone would want that, but then
again, I haven't used masked arrays.
Agreed, throwing some sort of error still seems the simplest thing to do.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion