Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. top_5 = games.query('year_of_release >= 2014').groupby(['platform'],
  2.             as_index = False)['total_sales'].sum().sort_values('total_sales',
  3.                                 ascending = False).head(5)['platform'].tolist()
  4.  
  5. for name in top_5:
  6.     games.query('platform == @name').pivot_table(index = 'year_of_release',
  7.                         values = 'total_sales', aggfunc = 'sum').sort_values('year_of_release',
  8.                                                     ascending = False).plot(figsize = (10, 5), title = name)
  9.    
  10.     plt.xlabel('Дата релиза', labelpad = 10)
  11.     plt.ylabel('Продажи', labelpad = 50)
  12.     plt.legend()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement