# xarray.core.weighted.DataArrayWeighted¶

class xarray.core.weighted.DataArrayWeighted(obj, weights)
__init__(obj, weights)

Create a Weighted object

Parameters

Notes

weights must be a DataArray and cannot contain missing values. Missing values can be replaced by weights.fillna(0).

Methods

 __init__(obj, weights) Create a Weighted object mean([dim, skipna, keep_attrs]) Reduce this Dataset’s data by a weighted mean along some dimension(s). sum([dim, skipna, keep_attrs]) Reduce this Dataset’s data by a weighted sum along some dimension(s). sum_of_weights([dim, keep_attrs]) Calculate the sum of weights, accounting for missing values in the data

Attributes