David Cournapeau wrote:
> 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,
>>
which is in scipy.stats:
import numpy as np
from scipy.stats import nanmean
nanmean(np.array([1, 2, 3, np.nan])) # should return 2.
David