Untitled

From Speedy Duck, 11 Months ago, written in Plain Text, viewed 191 times.
URL http://codebin.org/view/7073bcc5 Embed
Download Paste or View Raw
  1. def genre_weekday (table, day, time1, time2):
  2.     genre_df = genre_df[genre_df['day'] == day]
  3.     genre_df = genre_df[genre_df['time'] < time2]
  4.     genre_df = genre_df[genre_df['time'] > time1]
  5.     genre_df_grouped = genre_df.groupby('genre')['genre'].count()
  6.     genre_df_sorted = genre_df_grouped.sort_values(ascending = False)
  7.    
  8.     return genre_df_sorted[:10]

Reply to "Untitled"

Here you can reply to the paste above