從 Zarr 資料集建立 Dask 陣列
你要分析歐洲氣溫,手上的資料集與 era_eu.hdf 相同,但這次是 Zarr 格式。Zarr 是一種現代且強大的資料集格式,用於儲存分塊資料。它特別適合在雲端運算服務上使用,在你自己的電腦上也同樣好用。
dask.array 已經替你匯入為 da。
本練習屬於課程
在 Python 中使用 Dask 進行平行程式設計
練習說明
- 使用
dask.array子套件的from_zarr()函式,從data/era_eu.zarr資料集中載入變數temp。 - 印出該陣列以查看分塊大小。
- 找出在所有時間與空間軸向上的最低氣溫。
- 計算結果。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Load the temperature data from the Zarr dataset
temps = da.____(____)
# Print the Dask array of temperatures to see the chunk sizes
print(____)
# Find the minimum of the mean monthly temperatures
all_time_low = ____
# Compute the answer
all_time_low_value = ____
print(all_time_low_value, "°C")