Above the Middle Everywhere
scores has columns student, subject and score, one row per student per subject they take. Return the names, alphabetically, of the students whose score is above the median score of the subject in every subject they take.
Example 1
scores {"student":["ann","bob","cy","ann","bob","cy"],"subject":["math","math","math","art","art","art"],"score":[90,70,50,85,80,60]}
returns ["ann"]
The medians are 70 in math and 80 in art. ann is above both. bob sits exactly on both medians, which is not above, and cy is below both.
Constraints
1 <= len(scores) <= 80
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More pandas problems
- Average Experience per ProjectMedium
- Back the Next DayMedium
- Crosstab CountsMedium
- Customers Who Bought EverythingMedium
- Date Range FilterMedium
- Deepest Fall per TickerMedium
- Department HeadcountMedium
- Earning More Than the ManagerMedium