FunctionRacerProblemsRace

Above Department Average

MediumpandasPython

staff has columns name, dept and salary. Return the names of people who earn strictly more than the average salary of their own department, in the order they appear.

Example 1

staff {"name":["a","b","c"],"dept":["x","x","y"],"salary":[10,20,5]}
returns ["b"]

x averages 15, so b is above it. y has only c.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More pandas problems