On 7/17/07, David Cournapeau <[EMAIL PROTECTED]> wrote:
> I noticed that min and max already ignore Nan, which raises the
> question: why are there nanmin and nanmax functions ?

Using min and max when you have NaNs is dangerous. Here's an example:

>> x = M.matrix([[ 1.0, 2.0, M.nan]])
>> x.min()
1.0

>> x = M.matrix([[ M.nan, 2.0, 1.0]])
>> x.min()
nan

I wish that min and max ignored NaNs. For me taking the time to check
for NaNs (slowing down min and max) is worth it. But it seems like
most people disagree. So I use nanmin and nanmax instead.
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to