Save up to $499! Grab all Python courses for $49 or all online courses we’ve ever launched for only $169. Only Feb 11-16. Happy Valentine's!
Filtering by row
Extracting data by column
Practice using filter() and select()
19. Subsetting rows and columns
The pipe operator
Sorting rows


Did you notice what we did? First, we filtered rows and assigned the results to a variable. Then, we selected columns. But actually, we can do all this in one step.

First, we will filter the Asian countries:

filter(countries, continent == "Asia")

From this set, we can choose the population and area columns. All together, this looks like:

select(filter(countries, continent == "Asia"), population, area) 


Select the population and area columns for all South American countries.

Stuck? Here's a hint!


select(filter(countries, continent == "South America"), population, area)