pandas の 移動平均とかの計算に便利
# 移動平均。重み付けなし df.rolling(window=3).mean() # 未来永劫平均取る的な。 df.expanding(min_periods=3).mean() # 移動平均。重み付けあり。 df.ewm(com=0.5).mean()
com : float, optional Specify decay in terms of center of mass, 𝛼=1/(1+𝑐𝑜𝑚), for 𝑐𝑜𝑚≥0 span : float, optional Specify decay in terms of span, 𝛼=2/(𝑠𝑝𝑎𝑛+1), for 𝑠𝑝𝑎𝑛≥1 halflife : float, optional Specify decay in terms of half-life, 𝛼=1−𝑒𝑥𝑝(𝑙𝑜𝑔(0.5)/ℎ𝑎𝑙𝑓𝑙𝑖𝑓𝑒), for ℎ𝑎𝑙𝑓𝑙𝑖𝑓𝑒>0