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

Method weighted

xarray/core/dataset.py:10323–10356  ·  view source on GitHub ↗

Weighted Dataset operations. Parameters ---------- weights : DataArray An array of weights associated with the values in this Dataset. Each value in the data contributes to the reduction operation according to its associated weigh

(self, weights: DataArray)

Source from the content-addressed store, hash-verified

10321 )
10322
10323 def weighted(self, weights: DataArray) -> DatasetWeighted:
10324 """
10325 Weighted Dataset operations.
10326
10327 Parameters
10328 ----------
10329 weights : DataArray
10330 An array of weights associated with the values in this Dataset.
10331 Each value in the data contributes to the reduction operation
10332 according to its associated weight.
10333
10334 Notes
10335 -----
10336 ``weights`` must be a DataArray and cannot contain missing values.
10337 Missing values can be replaced by ``weights.fillna(0)``.
10338
10339 Returns
10340 -------
10341 computation.weighted.DatasetWeighted
10342
10343 See Also
10344 --------
10345 :func:`DataArray.weighted <DataArray.weighted>`
10346
10347 :ref:`compute.weighted`
10348 User guide on weighted array reduction using :py:func:`~xarray.Dataset.weighted`
10349
10350 :doc:`xarray-tutorial:fundamentals/03.4_weighted`
10351 Tutorial on Weighted Reduction using :py:func:`~xarray.Dataset.weighted`
10352
10353 """
10354 from xarray.computation.weighted import DatasetWeighted
10355
10356 return DatasetWeighted(self, weights)
10357
10358 def rolling(
10359 self,

Callers 13

_sum_of_squaresMethod · 0.45
_cov_corrFunction · 0.45
weighted_meanMethod · 0.45
mean_funcFunction · 0.45
test_weighted_bad_dimFunction · 0.45
weighted_meanMethod · 0.45

Calls 1

DatasetWeightedClass · 0.90

Tested by 11

weighted_meanMethod · 0.36
mean_funcFunction · 0.36
test_weighted_bad_dimFunction · 0.36
weighted_meanMethod · 0.36
test_weightedMethod · 0.36