Python Filter Rows
boolean maskPractice

Keep rows where score >= 85

Build a True/False mask, then index the DataFrame with it. Press Run to watch each row get kept or dropped.

Picture this: keep rows that match

A mask picks rows. False rows drop out.

full tableall rows
→
score >= 85mask
→
df[mask]keep True

In easy words

Pandas compares each score to 85. Indexing with that mask returns only matching rows.

Where this is used

High scorers, overdue invoices, failed tests, active users.

Run algorithm

Each step highlights the matching Python line. Program output appears only when a line that prints actually runs.

Ready
namescoremask
A90?
B80?
C88?
1import pandas as pd
2df = pd.DataFrame({"name": ["A","B","C"], "score": [90,80,88]})
3print(df[df["score"] >= 85])
Output:

Example Program

1import pandas as pd
2df = pd.DataFrame({"name": ["A","B","C"], "score": [90,80,88]})
3print(df[df["score"] >= 85])