Created
February 5, 2022 16:56
-
-
Save erap129/e12d2884fa4bfea9779f9fb129641ae3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rating_by_genre_df = ratings_df.join(movies_df_exploded, on='movie_id').\ | |
groupby('genre').agg({'rating': ['mean', 'count']}).sort_values(('rating', 'mean')).reset_index() | |
rating_by_genre_df.columns = ['_'.join(col).strip() for col in rating_by_genre_df.columns.values] | |
px.bar(rating_by_genre_df, x='genre_', y='rating_mean', height=300) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment