Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
256 B
1
Indexable
Never
def genre_weekday(df, day, time1, time2):
    genre_df = df[(df['day'] == day) & (df['time'] < time2) & (df['time'] > time1)]
    genre_df_sorted = genre_df.groupby('genre')['genre'].count().sort_values(ascending = False)
    return genre_df_sorted[:10]