Above Department Average
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
- The result may be an empty list
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More pandas problems
- Above the Middle EverywhereMedium
- Average Experience per ProjectMedium
- Back the Next DayMedium
- Crosstab CountsMedium
- Customers Who Bought EverythingMedium
- Date Range FilterMedium
- Deepest Fall per TickerMedium
- Department HeadcountMedium