polars.Expr.clip_max#

Expr.clip_max(max_val: int | float) Expr[source]#

Clip (limit) the values in an array to a max boundary.

Only works for numerical types.

If you want to clip other dtypes, consider writing a “when, then, otherwise” expression. See when() for more information.

Parameters:
max_val

Maximum value.