MCPcopy Index your code
hub / github.com/numpy/numpy / clip

Method clip

numpy/_core/tests/test_numeric.py:2331–2334  ·  view source on GitHub ↗
(self, a, m, M, out=None)

Source from the content-addressed store, hash-verified

2329 return a.clip(m, M, out=out, **kwargs)
2330
2331 def clip(self, a, m, M, out=None):
2332 # use a.choose to verify fastclip result
2333 selector = np.less(a, m) + 2 * np.greater(a, M)
2334 return selector.choose((a, m, M), out=out)
2335
2336 # Handy functions
2337 def _generate_data(self, n, m):

Callers 15

test_simple_doubleMethod · 0.95
test_simple_intMethod · 0.95
test_array_doubleMethod · 0.95
test_simple_nonnativeMethod · 0.95
test_simple_complexMethod · 0.95
test_clip_non_contigMethod · 0.95
test_simple_outMethod · 0.95
test_simple_int64_outMethod · 0.95
test_simple_int32_outMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected