Winsorize a numeric vector: compute its lower and upper quantiles (defaults 0.05 and 0.95) and clip every value to that range. Extreme values are pulled in to the cut-offs instead of being removed.
Implement solve(x, lower=0.05, upper=0.95).
Returns. Return a NumPy array of the same length. Quantiles use NumPy's default linear interpolation.
Example 1
Input:
solve([1.0, 2.0, 3.0, 4.0, 100.0], 0.2, 0.8)
Output:
[1.8, 2.0, 3.0, 4.0, 23.2]
Example 2
Input:
solve([5.0, 5.0, 5.0])
Output:
[5.0, 5.0, 5.0]
No results yet
Run your code to check it against the examples, or submit to run every test.