从 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")