开始使用免费开始使用

按市场查看类型

我们已为您创建了一个基于 sales 数据的视图 genre_market_totals,用于展示各个 theater_locationmovie_genre 的表现。您可以在控制台中使用 .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()
编辑并运行代码