Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- top_5 = games.query('year_of_release >= 2014').groupby(['platform'],
- as_index = False)['total_sales'].sum().sort_values('total_sales',
- ascending = False).head(5)['platform'].tolist()
- for name in top_5:
- games.query('platform == @name').pivot_table(index = 'year_of_release',
- values = 'total_sales', aggfunc = 'sum').sort_values('year_of_release',
- ascending = False).plot(figsize = (10, 5), title = name)
- plt.xlabel('Дата релиза', labelpad = 10)
- plt.ylabel('Продажи', labelpad = 50)
- plt.legend()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement