Question 1
Consider the following pandas DataFrame representing employee training records:
We want to retrieve all records of employees who belong to departments where the average training score is strictly greater than 75. Which of the following code snippets correctly achieves this?
df[df['Score'] > 75]
df.groupby('Department').filter(lambda x: x['Score'].mean() > 75)
df[df.groupby('Department')['Score'].transform('mean') >= 75]
df.groupby('Department').apply(lambda x: x[x['Score'] > 75])
