pandas 1.4.2

ParametersReturns
mean(self, *args, update=None, update_times=None, **kwargs)

Parameters

update: DataFrame or Series, default None :

New values to continue calculating the exponentially weighted mean from the last values and weights. Values should be float64 dtype.

update needs to be None the first time the exponentially weighted mean is calculated.

update_times: Series or 1-D np.ndarray, default None :

New times to continue calculating the exponentially weighted mean from the last values and weights. If None , values are assumed to be evenly spaced in time. This feature is currently unsupported.

Returns

DataFrame or Series

Calculate an online exponentially weighted mean.

Examples

This example is valid syntax, but we were not able to check execution
>>> df = pd.DataFrame({"a": range(5), "b": range(5, 10)})
... online_ewm = df.head(2).ewm(0.5).online()
... online_ewm.mean() a b 0 0.00 5.00 1 0.75 5.75
This example is valid syntax, but we were not able to check execution
>>> online_ewm.mean(update=df.tail(3))
          a         b
2  1.615385  6.615385
3  2.550000  7.550000
4  3.520661  8.520661
This example is valid syntax, but we were not able to check execution
>>> online_ewm.reset()
... online_ewm.mean() a b 0 0.00 5.00 1 0.75 5.75
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/window/ewm.py#940
type: <class 'function'>
Commit: