Return an array whose values are limited to ``[min, max]``. At least one of max or min must be given. Refer to `numpy.clip` for full documentation. See Also -------- numpy.clip : equivalent function
(self, min=None, max=None)
| 1712 | return ops.where_method(self, cond, other) |
| 1713 | |
| 1714 | def clip(self, min=None, max=None): |
| 1715 | """ |
| 1716 | Return an array whose values are limited to ``[min, max]``. |
| 1717 | At least one of max or min must be given. |
| 1718 | |
| 1719 | Refer to `numpy.clip` for full documentation. |
| 1720 | |
| 1721 | See Also |
| 1722 | -------- |
| 1723 | numpy.clip : equivalent function |
| 1724 | """ |
| 1725 | from xarray.computation.apply_ufunc import apply_ufunc |
| 1726 | |
| 1727 | xp = duck_array_ops.get_array_namespace(self.data) |
| 1728 | return apply_ufunc(xp.clip, self, min, max, dask="allowed") |
| 1729 | |
| 1730 | def reduce( # type: ignore[override] |
| 1731 | self, |