xarray.core.weighted.DataArrayWeighted¶
-
class
xarray.core.weighted.DataArrayWeighted(obj, weights)¶ -
__init__(self, obj, weights)¶ Create a Weighted object
- Parameters
Notes
weightsmust be aDataArrayand cannot contain missing values. Missing values can be replaced byweights.fillna(0).
Methods
__init__(self, obj, weights)Create a Weighted object
mean(self, dim, Iterable[Hashable], …)Reduce this Dataset’s data by a weighted
meanalong some dimension(s).sum(self, dim, Iterable[Hashable], …)Reduce this Dataset’s data by a weighted
sumalong some dimension(s).sum_of_weights(self, dim, …)Calculate the sum of weights, accounting for missing values in the data
Attributes
objweights-