[Numpy-discussion] Why NaN?

Pierre GM pgmdevlist at gmail.com
Tue Aug 4 15:29:47 EDT 2009


On Aug 4, 2009, at 2:43 PM, Robert Kern wrote:

> On Tue, Aug 4, 2009 at 13:40, Gökhan Sever<gokhansever at 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...




More information about the NumPy-Discussion mailing list