自訂義長條圖
在這個練習中,我們要探索中學學生的資料。變數 "study_time" 紀錄每位學生回報的每週讀書時間,屬於下列其中一個類別:"<2 hours"、"2 to 5 hours"、"5 to 10 hours"、或 ">10 hours"。讀書時間回報較多的學生,期末成績是否通常更好?讓我們用長條圖比較各類別學生的平均期末成績。
Seaborn 已匯入為 sns,matplotlib.pyplot 已匯入為 plt。
本練習屬於課程
Seaborn 資料視覺化入門
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Create bar plot of average final grade in each study category
# Show plot
plt.show()