[Numpy-discussion] sorting -inf, nan, inf

Sasha ndarray at mac.com
Tue Sep 19 15:13:55 CDT 2006

On 9/19/06, Keith Goodman <kwgoodman at gmail.com> 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
appropriate values:

x[isnan(x)] = inf # if you want nans on the right

More information about the Numpy-discussion mailing list