MCPcopy
hub / github.com/pydata/xarray / _weighted_sum

Method _weighted_sum

xarray/computation/weighted.py:271–279  ·  view source on GitHub ↗

Reduce a DataArray by a weighted ``sum`` along some dimension(s).

(
        self,
        da: T_DataArray,
        dim: Dims = None,
        skipna: bool | None = None,
    )

Source from the content-addressed store, hash-verified

269 return self._reduce((demeaned**2), self.weights, dim=dim, skipna=skipna) # type: ignore[return-value]
270
271 def _weighted_sum(
272 self,
273 da: T_DataArray,
274 dim: Dims = None,
275 skipna: bool | None = None,
276 ) -> T_DataArray:
277 """Reduce a DataArray by a weighted ``sum`` along some dimension(s)."""
278
279 return self._reduce(da, self.weights, dim=dim, skipna=skipna) # type: ignore[return-value]
280
281 def _weighted_mean(
282 self,

Callers 1

_weighted_meanMethod · 0.95

Calls 1

_reduceMethod · 0.95

Tested by

no test coverage detected