Question
What does `df[df[‘age’] >= 18]` do in pandas?
Select an option. Your answer will be checked instantly.
Correct Answer: A. Selects rows whose age value is at least 18
Explanation:
The comparison creates a Boolean mask indicating which rows satisfy the condition. Using that mask inside brackets filters the DataFrame to matching rows.
Leave a Reply