Dask arrays จากชุดข้อมูล Zarr
แบบฝึกหัดนี้ให้วิเคราะห์อุณหภูมิในยุโรป โดยใช้ชุดข้อมูลเดิมกับที่อยู่ใน era_eu.hdf แต่คราวนี้อยู่ในรูปแบบ Zarr Zarr เป็นรูปแบบชุดข้อมูลสมัยใหม่ที่มีประสิทธิภาพสูงสำหรับจัดเก็บข้อมูลแบบ chunked เหมาะอย่างยิ่งสำหรับบริการ cloud computing และยังใช้งานได้ดีบนเครื่องของคุณเองด้วย
ได้นำเข้า dask.array ไว้ให้แล้วในชื่อ da
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Parallel Programming with Dask in Python
คำแนะนำการฝึกหัด
- ใช้ฟังก์ชัน
from_zarr()จากแพ็กเกจย่อยdask.arrayเพื่อโหลดตัวแปรtempจากชุดข้อมูลdata/era_eu.zarr - พิมพ์อาร์เรย์เพื่อดูขนาด chunk
- หาอุณหภูมิต่ำสุดบนทุกแกนของเวลาและพื้นที่
- คำนวณผลลัพธ์
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
# 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")