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

Method clip

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

Source from the content-addressed store, hash-verified

1840 return a.clip(m, M, out=out, **kwargs)
1841
1842 def clip(self, a, m, M, out=None):
1843 # use a.choose to verify fastclip result
1844 selector = np.less(a, m) + 2*np.greater(a, M)
1845 return selector.choose((a, m, M), out=out)
1846
1847 # Handy functions
1848 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 1

lessMethod · 0.45

Tested by

no test coverage detected