Skip to content
Advertisement

How to make a sum in NetCDF4 by xarray

I would like to make a monthly sums of my NetCDF4 file from daily values for precipitation. However, I am quite not sure what I am doing wrong. It seems that something has changed from the code in this post: Sum a daily time series into a monthly time series with a NaN value threshold

I didn’t find anything helpful in the library documentation.

Here is my code:

JavaScript

My ValueError:

JavaScript

Advertisement

Answer

I founded that this command works for me!

JavaScript

However, the documentation of xarray.Dataset.resample can be quite confusing, as the first argument of the function – indexer is not typically written! So be aware of that! :-)

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement