[Numpy-discussion] min() of array containing NaN
Tue Aug 12 02:54:32 CDT 2008
2008/8/12 Stéfan van der Walt <firstname.lastname@example.org>:
> Hi Andrew
> 2008/8/12 Andrew Dalke <email@example.com>:
>> This is buggy for the case of a list containing only NaNs.
>> >>> import numpy as np
>> >>> np.NAN
>> >>> np.min([np.NAN])
>> >>> np.nanmin([np.NAN])
> Thanks for the report. This should be fixed in r5630.
Er, is this actually a bug? I would instead consider the fact that
np.min() raises an exception a bug of sorts - the identity of min is
inf. Really nanmin of an array containing only nans should be the same
as an empty array; both should be infinity.
I guess this is a problem for types that don't have an infinity
(returning maxint is a poor substitute), but what is the correct
More information about the Numpy-discussion