[Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

Charles R Harris charlesr.harris at gmail.com
Wed Oct 2 12:03:43 EDT 2013

Hi All,

The question is what to do when all-nan slices are encountered in the
nan{max,min} and nanarg{max, min} functions. Currently in 1.8.0, the first
returns nan and raises a warning, the second returns intp.min and raises a
warning. It is proposed that the nanarg{max, min} functions, and possibly
the nan{max, min} also, raise an error instead. Raising errors would be
consistent with the behavior of the arg{max, min} and amax/amin functions
when they encounter empty arrays. OTOH, now that we no longer support
Python 2.4/2.5 the catch_warnings context manager can serve the same
purpose by changing the warnings into exceptions. So, what to do?


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

More information about the NumPy-Discussion mailing list