[SciPy-user] calculate average by excluding NaN value in Array

David Cournapeau david@ar.media.kyoto-u.ac...
Mon Mar 30 05:27:11 CDT 2009

Ch B Komaki wrote:
> Dear Sirs/Madams
> I wanna calculate average of some lists, but having Nan value makes
> difficult to calculate average of data , I wanna exclude the position
> has NaN.It should calculate  average of  the others instead  ;
> for example;

nanmean should do what you want,


More information about the SciPy-user mailing list