简体   繁体   中英

Creating time series from gridded meteorological dataset in NETCDF4 format

I am creating a time series from a gridded dataset in the NETCDF4 format using the instructions provided in this link: http://www.matteodefelice.name/post/aggregating-gridded-data/

However, at the very end, I get an error when trying to group the temperatures by time, using the code:

x = out_sel.groupby('time').mean()

The following error appears: "ValueError: cannot reduce over dimensions ['time']. expected either '...' to reduce over all dimensions or one or more of Frozen(SortedKeysDict({'latitude': 5, 'longitude': 8}))."

How can I solve this problem? Help will be highly appreciated!

Matteo De Felice was very kind and answered to my question. The solution is very simple and to efficiently run the code it is necessary to update it as follows:

x = out_sel.groupby('time').mean(...)

I used the code provided by Matteo on the E-OBS dataset focusing on provinces in Italy. Therefore, the code shows to be easily applied to other datasets and purposes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM