Equana

Back to Numerical Arrays (NumPy)

np.clip

Clip (limit) the values in an array.

Syntax

np.clip(a, a_min, a_max)

Description

Clip (limit) the values in an array. Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of [0, 1] is specified, values smaller than 0 become 0, and values larger than 1 become 1.

Parameters

NameDescription
a- Array containing elements to clip
a_min- Minimum value. If null, clipping is not performed on the lower interval edge.
a_max- Maximum value. If null, clipping is not performed on the upper interval edge.

Returns

Promise<NDArray>