MCPcopy Create free account
hub / github.com/Lauriat/funct / clip_

Method clip_

funct/Array.py:316–320  ·  view source on GitHub ↗

Clip the values in the Array in-place.

(self, _min, _max)

Source from the content-addressed store, hash-verified

314 return Array(a)
315
316 def clip_(self, _min, _max):
317 """ Clip the values in the Array in-place. """
318 warn()
319 self[:] = Array(map(lambda e: max(min(e, _max), _min), self))
320 return self
321
322 def roll(self, n, inplace=False):
323 """ Rolls the elements of the Array. """

Callers 1

testMethod · 0.95

Calls 1

ArrayClass · 0.85

Tested by 1

testMethod · 0.76