๐Ÿพ Xarray is now 10 years old! ๐ŸŽ‰

xarray.core.weighted.DataArrayWeighted.sum_of_weights

xarray.core.weighted.DataArrayWeighted.sum_of_weights#

DataArrayWeighted.sum_of_weights(dim=None, *, keep_attrs=None)[source]#

Calculate the sum of weights, accounting for missing values in the data.

Parameters:
  • dim (str or sequence of str, optional) โ€“ Dimension(s) over which to sum the weights.

  • keep_attrs (bool, optional) โ€“ If True, the attributes (attrs) will be copied from the original object to the new one. If False (default), the new object will be returned without attributes.

Returns:

reduced (Dataset) โ€“ New Dataset object with the sum of the weights over the given dimension.