问题描述
我收到错误消息:AttributeError: module 'pandas' has no attribute 'ewmstd'
在上一个具有解决方案的堆栈溢出帖子中,我发现EWM function
的问题完全相同,如下所示:
df = pd.ewm(halflife=0.5).mean()
因此,除了将ewm
替换为ewmstd
之外,我复制了完全相同的解决方案(适用于 ewm )
df = pd.ewmstd(halflife=0.5).mean()
但是,我得到了相同的错误消息。我也尝试了不同的变体,但是得到了相同的错误。
我是否错误地调用了该函数,或者一个函数如何调用它? (我使用此处的文档:https://pandas.pydata.org/pandas-docs/version/0.17.0/generated/pandas.ewmstd.html
解决方法
我使用了df = pd.ewm(halflife=0.5).std()
,它在DataFrame上产生结果。
我可能希望它能提供相同的输出?