Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- df = pd.read_csv('music_log_upd.csv')
- #группирую данные вокруг 'genre_name', отсеиваю по 'user_id'
- genre_grouping = df.groupby('user_id')['genre_name'].count()
- #print(genre_grouping) - проверка работоспобоности genre_grouping
- # посчитаем количество жанров
- genre_counting = df.groupby('user_id')['genre_name'].sum()
- print(genre_counting.head(30))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement