[SciPy-user] arrays mean & NaN...

eric eric@enthought....
Sat Sep 8 13:42:48 CDT 2007


Travis O., Robert K.,and I were discussing adding nanmean, etc.to the 
nanmin, nanmax methods early this week...

Sounds like others might find this useful as well.

eric


fred wrote:
> Hi,
>
> When I compute the mean of several arrays (the mean is an array),
> and if one of several of these arrays has NaN in a given cell, the
> mean of this cell is also NaN.
>
> I would like to have the mean of the all non-NaN is this cell.
>
> How could I do this ?
>
> PS: To be more efficient, I don't mind if it is not the "right" mean, ie 
> divided by the real
> number of non-NaN, but the number of arrays.
>
> But, just curious, I'm also interested by a solution for the right mean ;-)
>
> TIA
>
> Cheers,
>
>   



More information about the SciPy-user mailing list