【发布时间】:2021-05-14 20:12:51
【问题描述】:
genre_game=group_game.groupby(["Genre","Name"])"Global_Sales"].sum().reset_index().sort_values(["Genre","Global_Sales"],ascending=(True,False))
genre_game
genre_s=df["Genre"].unique()
genre_sorted=sorted(genre_s)
print(f'List of : {genre_sorted}' )
列表:['Action', 'Adventure', 'Fighting', 'Misc', 'Platform', 'Puzzle', 'Racing', 'Role-Playing', 'Shooter', 'Simulation', '体育”、“策略”]
def f(genre):
for genre in genre_sorted:
plt.bar(genre_game[genre][:5],genre_game["Global_Sales"][genre:genre+5])
plt.xticks(rotation=90)
f("Adventure")
【问题讨论】:
-
请不要将数据/代码/错误消息作为图片发布。在 SO 上直接在此处发布文本。
-
会记住这一点
标签: python pandas dataframe matplotlib data-analysis