Statsmodels版本0.6.1不包括tsa?

时间:2014-12-05 22:29:09

标签: python statsmodels

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

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

1 个答案:

答案 0 :(得分:10)

您需要import statsmodels.api as sm