Cap the Salaries
staff has columns name and salary. Every salary above cap is cut down to cap; smaller salaries stay the same. Return the new salaries as a list, in the original row order. Do not change staff.
Example 1
staff {"name":["a","b","c"],"salary":[50,120,90]}
cap 100
returns [50,100,90]
Only the 120 is cut down to 100.
Constraints
- The tables are small
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More pandas problems
- Carry the Last ValueBeginner
- Colour TallyBeginner
- Column StatisticsBeginner
- Column TotalBeginner
- Correlation of ColumnsBeginner
- Count Missing ValuesBeginner
- Count Repeated RowsBeginner
- Count Unique CitiesBeginner