開始使用免費開始

依市場檢視類型

已為你建立一個 sales 資料的檢視表,涵蓋各 theater_locationmovie_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 軸標籤分別為 MarketRevenue (USD)

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Create barplot
sns.barplot(x=____, y=____, hue=____, data=____)

# Add labels
plt.____('Genre Performance by Market')
plt.____('Market')
plt.____('Revenue (USD)')

plt.show()
編輯並執行程式碼