1. Learn
  2. /
  3. Courses
  4. /
  5. Python for Spreadsheet Users

Connected

Exercise

Putting it all together again

Now that we have a better understanding of how merges can enrich our data, let's revisit a summary table.

Currently loaded are two DataFrames:

  • transactions - A full list of each ticket sale transaction - but no information on movie genre.
  • movies - A table of our movie titles and genre

Let's put these two tables together to create a view we took for granted before - ticket quantity sold for each genre.

Instructions

100 XP
  • Merge transactions with movies on the movie_title column.
  • Group by movie_genre and sum. Store the result in genre_summary.
  • Sort genre_summary by ticket_quantity. Store the result as genre_summary_sorted.
  • Print genre_summary_sorted (this has been done for you).