[Numpy-discussion] Why NaN?

Robert Kern robert.kern@gmail....
Tue Aug 4 14:40:19 CDT 2009

On Tue, Aug 4, 2009 at 14:29, Pierre GM<pgmdevlist@gmail.com> wrote:
> On Aug 4, 2009, at 2:43 PM, Robert Kern wrote:
>> On Tue, Aug 4, 2009 at 13:40, Gökhan Sever<gokhansever@gmail.com>
>> wrote:
>>> This is the loveliest of all solutions:
>>> c[isfinite(c)].mean()
>> I kind of like c[c == c].mean(), but only because it's a bit mind-
>> blowing. :-)
> But it doesn't give the same result as the previous one when there's
> an inf...

NaNs might be markers of missing data, but I see infs as data.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

More information about the NumPy-Discussion mailing list