視覺化耐用度差異
在完成玩具耐用度的分析後,研究團隊希望你將教育類與娛樂類玩具的耐用度分數分佈可視化。這樣的圖形能提供直觀的洞見,幫助你看出各類別內分數的範圍與變異。這一步對於向非技術利害關係人呈現結果,以及引導後續產品開發決策都很重要。
資料已存於 toy_durability DataFrame,且已載入 seaborn 與 matplotlib.pyplot,分別命名為 sns 與 plt。
本練習屬於課程
Python 的實驗設計
練習說明
- 使用核密度估計(Kernel Density Estimate,KDE)圖,視覺化教育與娛樂玩具的
'Durability_Score'分佈,並利用'Toy_Type'欄位為分佈著色,以凸顯差異。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Visualize the distribution of Durability_Score for each Toy_Type
sns.____(data=____, x="____",
hue="____", kind="____")
plt.title('Durability Score Distribution by Toy Type')
plt.xlabel('Durability Score')
plt.ylabel('Density')
plt.show()