Clip the values in the Array between the interval (`_min`, `_max`).
(self, _min, _max, inplace=False)
| 305 | return Array(itertools.accumulate(self, l)) |
| 306 | |
| 307 | def clip(self, _min, _max, inplace=False): |
| 308 | """ |
| 309 | Clip the values in the Array between the interval (`_min`, `_max`). |
| 310 | """ |
| 311 | a = map(lambda e: max(min(e, _max), _min), self) |
| 312 | if inplace: |
| 313 | return self.__setinplace(a, inplace) |
| 314 | return Array(a) |
| 315 | |
| 316 | def clip_(self, _min, _max): |
| 317 | """ Clip the values in the Array in-place. """ |