xarray.core.weighted.DatasetWeighted¶
-
class
xarray.core.weighted.
DatasetWeighted
(obj, weights)¶ -
__init__
(obj, weights)¶ Create a Weighted object
Parameters: Notes
weights
must be aDataArray
and cannot contain missing values. Missing values can be replaced byweights.fillna(0)
.
Methods
__init__
(obj, weights)Create a Weighted object mean
(dim, Iterable[Hashable], None] = None, …)Reduce this Dataset’s data by a weighted mean
along some dimension(s).sum
(dim, Iterable[Hashable], None] = None, …)Reduce this Dataset’s data by a weighted sum
along some dimension(s).sum_of_weights
(dim, Iterable[Hashable], …)Calculate the sum of weights, accounting for missing values in the data Attributes
obj
weights
-