Skip to content

Instantly share code, notes, and snippets.

books.groupby('authors').describe()
books.groupby('authors')[['ratings_count','average_rating']].describe()
books[books['authors'] == 'J.K. Rowling-Mary GrandPré']
values = books[books['authors'] == 'J.K. Rowling-Mary GrandPré']['average_rating'].values
values
sum(values)/len(values)
books[books['authors'] == 'J.K. Rowling-Mary GrandPré']['average_rating'].mean()
books['average_rating'].mean()
grouped_df = books.groupby('authors').mean()
grouped_df.loc['A.M. Homes']
books.groupby('authors',as_index=False).mean()
books.groupby('authors').mean().reset_index()