MCPcopy Index your code
hub / github.com/pydata/xarray / clip

Method clip

xarray/core/variable.py:1714–1728  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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,

Callers 8

clipFunction · 0.45
_get_hMethod · 0.45
test_clipFunction · 0.45
test_array_interfaceMethod · 0.45
test_clipFunction · 0.45
test_clipMethod · 0.45
test_array_interfaceMethod · 0.45
test_clipFunction · 0.45

Calls 1

apply_ufuncFunction · 0.90

Tested by 6

test_clipFunction · 0.36
test_array_interfaceMethod · 0.36
test_clipFunction · 0.36
test_clipMethod · 0.36
test_array_interfaceMethod · 0.36
test_clipFunction · 0.36