On Sep 19, 2006, at 9:45 PM, Tim Hochberg wrote:
Perhaps there's some use for the sort to end behaviour that I'm
missing,
but the raise an exception behaviour sure looks a lot more
appealing to me.
FYI, in IDL the NaN values wind up at the end of the sorted array.
That's true despite
Charles R Harris wrote:
Thinking a bit, keeping the values in place isn't easy.
Why the heck would in place be desirable for sorted data anyway? I
understand that it means that if there is a NaN in the nth position
before sorting, there will be one in the nth position after sorting.
However,
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
In numpy 1.0b1 nan is always left where it began:
EXAMPLE 1
x
matrix([[
On 9/19/06, A. M. Archibald [EMAIL PROTECTED] wrote:
On 19/09/06, Tim Hochberg [EMAIL PROTECTED] 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
On 9/19/06, Keith Goodman [EMAIL PROTECTED] wrote:
Is there an easy way to use isnan to pull out the nans if the matrix I
am sorting has more than one column?
There seems to be a nan_to_num function that converts nans to zeros,
but I would suggest just using fancy indexing to fill the nans with
A. M. Archibald wrote:
On 19/09/06, Tim Hochberg [EMAIL PROTECTED] 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
On 9/19/06, Tim Hochberg [EMAIL PROTECTED] wrote:
A. M. Archibald wrote: On 19/09/06, Tim Hochberg [EMAIL PROTECTED] 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
Charles R Harris wrote:
On 9/19/06, *Tim Hochberg* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
A. M. Archibald wrote:
On 19/09/06, Tim Hochberg [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
Keith Goodman wrote:
In what order would you like
On 19/09/06, Tim Hochberg [EMAIL PROTECTED] wrote:
A. M. Archibald wrote:
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.
Do you really think so? In my experience NaNs are nearly always just an
On 19/09/06, Tim Hochberg [EMAIL PROTECTED] wrote:
I'm not sure where the breakpoint is, but I was seeing failures for all
three sort types with N as high as 1. I suspect that they're all
broken in the presence of NaNs. I further suspect you'd need some
punishingly slow n**2 algorithm
On 9/19/06, Tim Hochberg [EMAIL PROTECTED] wrote:
Charles R Harris wrote: On 9/19/06, *Tim Hochberg* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
wrote: A. M. Archibald wrote: On 19/09/06, Tim Hochberg [EMAIL PROTECTED] mailto:
[EMAIL PROTECTED] wrote: Keith Goodman wrote: In what order would
On 19/09/06, Charles R Harris [EMAIL PROTECTED] wrote:
If this sort of thing can cause unexpected errors I wonder if it would be
worth it to have a global debugging flag that essentially causes isnan to
be called before any function applications.
That sounds very like the IEEE floating-point
A. M. Archibald wrote:
On 19/09/06, Charles R Harris [EMAIL PROTECTED] wrote:
If this sort of thing can cause unexpected errors I wonder if it would be
worth it to have a global debugging flag that essentially causes isnan to
be called before any function applications.
That
A. M. Archibald wrote:
On 19/09/06, Tim Hochberg [EMAIL PROTECTED] wrote:
I'm not sure where the breakpoint is, but I was seeing failures for all
three sort types with N as high as 1. I suspect that they're all
broken in the presence of NaNs. I further suspect you'd need some
Tim Hochberg wrote:
A. M. Archibald wrote:
On 19/09/06, Tim Hochberg [EMAIL PROTECTED] wrote:
I'm not sure where the breakpoint is, but I was seeing failures for all
three sort types with N as high as 1. I suspect that they're all
broken in the presence of NaNs. I further
On 9/19/06, A. M. Archibald [EMAIL PROTECTED] wrote:
On 19/09/06, Charles R Harris [EMAIL PROTECTED] wrote: If this sort of thing can cause unexpected errors I wonder if it would be worth it to have a global debugging flag that essentially causesisnan to
be called before any function
Travis Oliphant wrote:
Tim Hochberg wrote:
A. M. Archibald wrote:
On 19/09/06, Tim Hochberg [EMAIL PROTECTED] wrote:
I'm not sure where the breakpoint is, but I was seeing failures for all
three sort types with N as high as 1. I suspect that they're all
On 9/19/06, Tim Hochberg [EMAIL PROTECTED] wrote:
Travis Oliphant wrote: Tim Hochberg wrote: A. M. Archibald wrote: On 19/09/06, Tim Hochberg
[EMAIL PROTECTED] wrote: I'm not sure where the breakpoint is, but I was seeing failures for all three sort types with N as high as 1. I suspect that
On 19/09/06, Charles R Harris [EMAIL PROTECTED] wrote:
For floats we could use something like:
lessthan(a,b) := a b || (a == nan b != nan)
Which would put all the nans at one end and might not add too much overhead.
You could put an any(isnan()) out front and run this slower version
On 9/19/06, A. M. Archibald [EMAIL PROTECTED] wrote:
On 19/09/06, Charles R Harris [EMAIL PROTECTED] wrote: For floats we could use something like: lessthan(a,b) := a b || (a == nan b != nan)
Which would put all the nans at one end and might not add too much overhead.You could put an
Charles R Harris wrote:
On 9/19/06, *A. M. Archibald* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
On 19/09/06, Charles R Harris [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
For floats we could use something like:
lessthan(a,b) := a b
On 19/09/06, Tim Hochberg [EMAIL PROTECTED] 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
On 9/19/06, A. M. Archibald [EMAIL PROTECTED] wrote:
On 19/09/06, Tim Hochberg [EMAIL PROTECTED] 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 anexception.
23 matches
Mail list logo