Clamp
All functions · nseries package
Clamp
func (s Series) Clamp(low float64, high float64) Series
Clamp returns a value no lower than the specified low value and no higher than the specified high value. If the value provided is between low and high, it is returned unchanged.
The bounds are inclusive and in the series’ units, and the result is max(low, min(x, high)); a NaN value stays NaN. A NaN bound, or low > high, is invalid and gives all zeros. An infinite bound is valid and clamps one side only, and low == high is valid.