BaşlayınÜcretsiz Başlayın

Calculating the trend in European temperatures

You want to calculate the average European temperature from 1980 to present using the ERA5 dataset. This data is a Zarr dataset of monthly mean temperature and precipitation, on a grid of latitudes and longitudes. The Zarr file is chunked so that each subfile on the disk is an array of 15 latitudes, 15 longitudes, and 12 months.

xarray has been imported for you as xr.

Bu egzersiz

Parallel Programming with Dask in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Use xarray to open the "data/era_eu.zarr" dataset.
  • Calculate the mean of the temp DataArray over the lat and lon dimensions.
  • Perform a rolling mean over the time dimension using a window size of 12.
  • Plot the resulting time series of temp_rolling_mean.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Open the ERA5 dataset
ds = ____

# Select the temperature dataset and take the latitude and longitude mean
temp_timeseries = ds[____].____

# Calculate the 12 month rolling mean
temp_rolling_mean = temp_timeseries.____(____).____()

# Plot the result
____
plt.show()
Kodu Düzenle ve Çalıştır