FunctionRacerProblemsRace

Cap the Salaries

BeginnerpandasPython

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

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