Movie genre performance by location
Using our new techniques, we can now create more useful tables to inform our analyses.
For our sales data, we can condense our 1,000+ rows of transactions down to a few handfuls of rows to answer questions like "what genres do well in each market?" or "what movies do seniors like best?"
Let's answer the question about genres first!
Bu egzersiz
Python for Spreadsheet Users
kursunun bir parçasıdırEgzersiz talimatları
- Create a list that contains column names
theater_locationandmovie_genreand assign it to a variablegroups. - Use
.groupby()and.sum()with the proper arguments to create theby_location_genresummary table. - Print
by_location_genreto the console.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
# Create a list of groups to group by
# Create summary table of genres and locations
by_location_genre = sales.____(____, as_index=False).____()
# Print the summary table