🍾 Xarray is now 10 years old! 🎉

xarray.core.rolling_exp.RollingExp.sum

Contents

xarray.core.rolling_exp.RollingExp.sum#

RollingExp.sum(keep_attrs=None)[source]#

Exponentially weighted moving sum.

Parameters:

keep_attrs (bool, default: None) – If True, the attributes (attrs) will be copied from the original object to the new one. If False, the new object will be returned without attributes. If None uses the global default.

Examples

>>> da = xr.DataArray([1, 1, 2, 2, 2], dims="x")
>>> da.rolling_exp(x=2, window_type="span").sum()
<xarray.DataArray (x: 5)> Size: 40B
array([1.        , 1.33333333, 2.44444444, 2.81481481, 2.9382716 ])
Dimensions without coordinates: x