[Numpy-discussion] finishing ticket #1035

Charles R Harris charlesr.harris at gmail.com
Tue Jan 5 12:20:24 EST 2010


Hi All,

I'm looking at ticket
#1025<http://projects.scipy.org/numpy/ticket/1035#comment:4>with an
eye to bringing it to completion but there some issues that need
discussion. Currently there are three ways in which nans can be compared:
maximum/minimum, fmax/fmin, or the new sort order. The maximum/minimum
ufuncs propagate nans, i.e., they will always return a nan if one is
present. The fmax/fmin ufuncs don't propagate nans, they ignore nans when
possible. The new sort order sorts nans to the end, i.e., nans are treated
as larger than any non-nan number; at present there are no ufuncs that
correspond to the sort order. The issues I think need resolving are:

1) Should there be ufuncs corresponding to the sort order?
2) What should a.max(), a.argmax(), a.min(), and a.argmin() do?

I note that a.argmax() is not consistent with a.max() at the moment:

In [9]: a
Out[9]: array([  0.,   1.,   2.,   3.,  NaN,   5.,   6.,   7.,  NaN,  NaN])

In [10]: a.argmax()
Out[10]: 7

In [11]: a.max()
Out[11]: nan

Thoughts?

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20100105/ccc446a9/attachment.html>


More information about the NumPy-Discussion mailing list