繪製溫度圖
在這個練習中,你會檢視天氣資料集中的溫度欄位,評估這些資料是否可信。你會先列印摘要統計量,接著用盒狀圖將資料視覺化。
判斷數值是否合理時,請注意溫度單位是華氏(degrees Fahrenheit),不是攝氏!
本練習屬於課程
使用 pandas 分析警方執法活動
練習說明
- 讀取
weather.csv,存成名為weather的 DataFrame。 - 選取溫度欄位(
TMIN、TAVG、TMAX),並使用.describe()方法列印其摘要統計量。 - 建立盒狀圖以視覺化溫度欄位。
- 顯示圖表。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Read 'weather.csv' into a DataFrame named 'weather'
# Describe the temperature columns
print(____)
# Create a box plot of the temperature columns
____.plot(kind='box')
# Display the plot