WeCodeAcademy

Filtering Rows

Put a condition inside df[...] to keep only matching rows. Combine conditions with & (and) and | (or), each in parentheses. isin checks against a list, and query lets you write the condition as text.

Examplepython
Open in editor »
Quick check

Which operator combines two conditions with AND?

Your turn: write the code

Print the rows where the city is Paris.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.