[Numpy-discussion] What is the different between nanmin and min ?
Tue Jul 17 06:46:20 CDT 2007
On 7/17/07, David Cournapeau <firstname.lastname@example.org> 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 = M.matrix([[ M.nan, 2.0, 1.0]])
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.
More information about the Numpy-discussion