2014-12-05 343 views
3

我正在试图使用statsmodels(sm)使HP滤镜工作。Statsmodels版本0.6.1不包含tsa?

文档here意味着模块sm.tsa已经存在0.6.1,但我得到了以下错误:

>>> 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: 

回答

6

您需要import statsmodels.api as sm

相关问题