MCPcopy Create free account
hub / github.com/numpy/numpy / _clip

Function _clip

numpy/core/_methods.py:90–99  ·  view source on GitHub ↗
(a, min=None, max=None, out=None, **kwargs)

Source from the content-addressed store, hash-verified

88 return items
89
90def _clip(a, min=None, max=None, out=None, **kwargs):
91 if min is None and max is None:
92 raise ValueError("One of max or min must be given")
93
94 if min is None:
95 return um.minimum(a, max, out=out, **kwargs)
96 elif max is None:
97 return um.maximum(a, min, out=out, **kwargs)
98 else:
99 return um.clip(a, min, max, out=out, **kwargs)
100
101def _mean(a, axis=None, dtype=None, out=None, keepdims=False, *, where=True):
102 arr = asanyarray(a)

Callers

nothing calls this directly

Calls 1

clipMethod · 0.80

Tested by

no test coverage detected