def rolling_weighted_mean(series, window=200, min_periods=None):
min_periods = window if min_periods is None else min_periods
try:
return series.ewm(span=window, min_periods=min_periods).mean()
except BaseException:
return pd.ewma(series, span=window, min_periods=min_periods)
# ---------------------------------------------
评论列表
文章目录