Final Quiz

This quiz is to make sure you have fully grasped the concept of filtering DataFrames.

Final Quiz: Filtering DataFrames

1

Which of these is the correct syntax to combine multiple filters, such as artists with plays > 100, or artists from the UK with names starting with Th?

A)

df[df.plays > 100 | df.country == 'UK' & df.name.str.startswith('TH')]

B)

df[(df.plays > 100) | ( (df.country == 'UK') & (df.name.str.startswith('Th') )]

C)

df[df.plays > 100 | (df.country == 'UK' & df.name.str.startswith('TH'))]

Question 1 of 30 attempted

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.