1. Learn
  2. /
  3. Courses
  4. /
  5. Parallel Programming with Dask in Python

Exercise

Monthly mean temperatures

After seeing the analysis of the average temperatures, you simply need to see the rest of the months. This would be rather annoying to do using the method we used before as it involves a lot of complicated slicing in time to select the right months. Thankfully, with Xarray, it is a lot simpler.

The European weather dataset is available in your environment as the Xarray DataSet ds.

Instructions

100 XP
  • Use the datetime accessor in the 'time' coordinate of ds to assign the months to the variable months.
  • Select the 'temp' variable from ds and group it by the months.
  • Take the mean over the group to calculate the monthly means over all times.
  • Compute the result.