[Numpy-discussion] What is the different between nanmin and min ?

Timothy Hochberg tim.hochberg@ieee....
Wed Jul 18 21:17:08 CDT 2007


On 7/18/07, Robert Kern <robert.kern@gmail.com> wrote:
>
> Timothy Hochberg wrote:
>
> > The time is one issue. Another is that ignoring NaNs is only correct if
> > you are treating NaNs as missing values. If instead you are treating
> > them as non numbers, the results of some bogus computation, then raising
> > an error is a more appropriate response. If one was going to take the
> > time to check for NaNs, one strategy that I would probably support would
> > be to ignore the NaNs, but set the invalid flag. If the error state for
> > invalid was set to ignore, then this would work as the missing value
> > camp likes, otherwise it would raise an error or signal a warning.
>
> I'd almost be willing to make max() and min() always ignore quiet NaNs.
> The C99
> standard requires this, for example, (c.f. section F.9.9.2 of the C99
> standard).


Wow! It sure does. That surprises me as it seems antithetical to my
understanding of the concept of NaNs being non comparable. Perhaps my
understanding is just flawed, it wouldn't be the first time. Personally, I'd
still rather see the warning get set when NaNs are around. That's colored by
my usage patterns where if a NaN is present, it's a problem and I'd like to
know about sooner rather than later.

-- 
.  __
.   |-\
.
.  tim.hochberg@ieee.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070718/99d30a51/attachment.html 


More information about the Numpy-discussion mailing list