依市場檢視類型
已為你建立一個 sales 資料的檢視表,涵蓋各 theater_location 中 movie_genre 的表現,名稱為 genre_market_totals。你可以在主控台使用 .head() 方法先行查看。
這個資料表很適合使用 sns.barplot() 的 hue 參數,來探索各電影類型在每個市場(theater_location)的表現。
本練習屬於課程
給試算表使用者的 Python
練習說明
- 繪製
genre_market_totals的長條圖,x 軸為theater_location,y 軸為revenue,並以movie_genre作為 hue 進行區分。 - 加上標題
Genre Performance by Market,x 軸與 y 軸標籤分別為Market與Revenue (USD)。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Create barplot
sns.barplot(x=____, y=____, hue=____, data=____)
# Add labels
plt.____('Genre Performance by Market')
plt.____('Market')
plt.____('Revenue (USD)')
plt.show()