Best genres
Let's make another graphic, this time with movie genres instead.
Once again, here are the lines of code we used to summarize our sales data into genre_totals before graphing.
(scroll to the right to see more)
genre_totals = sales.groupby('movie_genre', as_index=False).sum()
genre_totals = genre_totals.sort_values('revenue', ascending=False).reset_index(drop=True)
Este ejercicio forma parte del curso
Python for Spreadsheet Users
Instrucciones del ejercicio
- Use
sns.barplot()to create a graph ofgenre_totalswithmovie_genreon the x axis andrevenueon the y-axis. - Display the plot.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
import seaborn as sns
import matplotlib.pyplot as plt
# Create barplot
# Display barplot