FunctionRacerProblemsRace

Clip Scores

BeginnerNumPyPython

Return a new array where every score below low is raised to low and every score above high is lowered to high. Scores already in the range stay the same. Hint: np.clip.

Example 1

scores [-5,40,120,100]
low 0
high 100
returns [0,40,100,100]

-5 becomes 0 and 120 becomes 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 NumPy problems