gpt4 book ai didi

python - Statsmodels 0.6.1版本不包含tsa?

转载 作者:太空狗 更新时间:2023-10-29 21:31:27 26 4
gpt4 key购买 nike

我正在尝试使用 statsmodels (sm) 让 HP 过滤器工作。

文档 here暗示 0.6.1 模块 sm.tsa 已经存在,但我收到以下错误:

>>> import statsmodels as sm
>>> sm.__version__
'0.6.1'
>>> sm.tsa.filters.hp_filter.hpfilter()
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'module' object has no attribute 'tsa'
>>> sm.tsa
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'module' object has no attribute 'tsa'

这是我的 pip 输出:

nat-oitwireless-inside-vapornet100-a-14423:prog2 foobar$ pip show statsmodels
---
Name: statsmodels
Version: 0.6.1
Location: /usr/local/lib/python2.7/site-packages/statsmodels-0.6.1-py2.7-macosx-10.9-x86_64.egg
Requires:

最佳答案

您需要将 statsmodels.api 导入为 sm

关于python - Statsmodels 0.6.1版本不包含tsa?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27325718/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com