Index merge for movie ratings
To practice merging on indexes, you will merge movies
and a table called ratings
that holds info about movie ratings. Ensure that your merge returns all rows from the movies
table, and only matching rows from the ratings
table.
The movies
and ratings
tables have been loaded for you.
This exercise is part of the course
Joining Data with pandas
Exercise instructions
- Merge the
movies
andratings
tables on theid
column, keeping all rows from themovies
table, and save the result asmovies_ratings
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Merge to the movies table the ratings table on the index
movies_ratings = ____
# Print the first few rows of movies_ratings
print(movies_ratings.head())