UCL-EO / geog0111

UCL MSc coursenotes
http://www2.geog.ucl.ac.uk/~plewis/geog0111
GNU General Public License v3.0
16 stars 18 forks source link

notebook 023_Plotting.ipynb small problem caused by nan value #33

Closed wanxinyang closed 2 years ago

wanxinyang commented 2 years ago

Notebook 023_Plotting.ipynb - the example data in Errorbar Section have NAN values for 2022 Oct-Dec because there is no data for these months yet.

The error bar graph cannot be plotted correctly unless get rid of nan in std. So, I would suggest to replace:

mean = np.array(df[months]).mean(axis=1)
std  = np.array(df[months]).std(axis=1)

by:

mean = np.nanmean(np.array(df[months]), axis=1)
std  = np.nanstd(np.array(df[months]), axis=1)