Clip Scores
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
1 <= len(scores) <= 100low <= high
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- CorrelationBeginner
- Count DistinctBeginner
- Count PositivesBeginner
- Count Target in GridBeginner
- Count the MaximumBeginner
- Cumulative MaxBeginner
- Day to Day ChangeBeginner
- Diagonal From ValuesBeginner