[Numpy-discussion] Why NaN?

Pierre GM pgmdevlist@gmail....
Tue Aug 4 14:29:47 CDT 2009


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...



More information about the NumPy-Discussion mailing list