clip(a: array, /, a_min: scalar | array | None, a_max: scalar | array | None, *, stream: None | Stream | Device = None) array#

Clip the values of the array between the given minimum and maximum.

If either a_min or a_max are None, then corresponding edge is ignored. At least one of a_min and a_max cannot be None. The input a and the limits must broadcast with one another.

  • a (array) – Input array.

  • a_min (scalar or array or None) – Minimum value to clip to.

  • a_max (scalar or array or None) – Maximum value to clip to.


The clipped array.

Return type: