Explore Library
Code QuizAdvanced

Filtering a DataFrame with two conditions

Spot the bug in a Pandas filter that combines two conditions.

Codepython
import pandas as pd

df = pd.read_csv("employees.csv")

# Select employees older than 30 who earn more than 50000
result = df[df["age"] > 30 & df["salary"] > 50000]

print(result.head())

What is the bug in this filtering code?