mean nan code example
Example 1: mean without nan matlab
y = nanmean( X )
Example 2: get the mean of all not nan values
In [108]: np.nanmean([np.nan, 1, 2, np.nan, 3])
Out[108]: 2.0
y = nanmean( X )
In [108]: np.nanmean([np.nan, 1, 2, np.nan, 3])
Out[108]: 2.0