Get startedGet started for free

Subsetting rows with .query()

In this exercise, you will revisit GDP and population data for Australia and Sweden from the World Bank and expand on it using the .query() method. You'll merge the two tables and compute the GDP per capita. Afterwards, you'll use the .query() method to sub-select the rows and create a plot. Recall that you will need to merge on multiple columns in the proper order.

The tables gdp and pop have been loaded for you.

This exercise is part of the course

Joining Data with pandas

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Merge gdp and pop on date and country with fill
gdp_pop = ____
Edit and Run Code