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)
| 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, |