Do sequels earn more?
It is time to put together many of the aspects that you have learned in this chapter. In this exercise, you'll find out which movie sequels earned the most compared to the original movie. To answer this question, you will merge a modified version of the sequels
and financials
tables where their index is the movie ID. You will need to choose a merge type that will return all of the rows from the sequels
table and not all the rows of financials
table need to be included in the result. From there, you will join the resulting table to itself so that you can compare the revenue values of the original movie to the sequel. Next, you will calculate the difference between the two revenues and sort the resulting dataset.
The sequels
and financials
tables have been provided.
This exercise is part of the course
Joining Data with pandas
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Merge sequels and financials on index id
sequels_fin = ____