hi, eva,

when i ran your code i found a misspell:
result = statsmodels.tsa.statools.adfuller(x,1)

when i fixed 'stattools' --
result = statsmodels.tsa.stattools.adfuller(x,1)

print result

(-2.6825663173365015, 0.077103947319183241, 0, 7, {'5%': -3.4775828571428571, 
'1%': -4.9386902332361515, '10%': -2.8438679591836733}, 15.971188911270618)

-- james

________________________________________
From: Tutor [tutor-bounces+jderry=mail.utexas....@python.org] on behalf of eva 
maria gualandi [evamaria.guala...@gmail.com]
Sent: Monday, December 16, 2013 10:56 AM
To: tutor@python.org
Subject: [Tutor] i installed the package statsmodels but i get an error when    
i use it

Good afternoon,
I installed from https://pypi.python.org/pypi/statsmodels the package 
statsmodels for python 2.7 (32bit) , i have to do some test statistics for a 
time series analysis that i can find under statsmodels.tsa. In particular i 
really need to do a Dickey Fuller test and in agreement with the statsmodels 
documentation ( from 
http://statsmodels.sourceforge.net/devel/generated/statsmodels.tsa.stattools.adfuller.html
 ) i run this simple programm

import numpy as np
import statsmodels
from statsmodels.tsa import stattools
x = np.array([1,2,3,4,3,4,2,3])
result = statsmodels.tsa.statools.adfuller(x,1)
print result

but unfortunately i get the following error message:

Traceback (most recent call last):
  File "C:\Python27\esempio_adftest.py", line 3, in <module>
    from statsmodels.tsa import stattools
  File "C:\Python27\lib\site-packages\statsmodels\tsa\stattools.py", line 7, in 
<module>
    from statsmodels.regression.linear_model import OLS, yule_walker
  File "C:\Python27\lib\site-packages\statsmodels\regression\__init__.py", line 
1, in <module>
    from linear_model import yule_walker
  File "C:\Python27\lib\site-packages\statsmodels\regression\linear_model.py", 
line 37, in <module>
    from statsmodels.tools.tools import (add_constant, rank,
  File "C:\Python27\lib\site-packages\statsmodels\tools\__init__.py", line 1, 
in <module>
    from tools import add_constant, categorical
  File "C:\Python27\lib\site-packages\statsmodels\tools\tools.py", line 14, in 
<module>
    from pandas import DataFrame
  File "C:\Python27\lib\site-packages\pandas\__init__.py", line 15, in <module>
    raise ImportError('C extensions not built: if you installed already '
ImportError: C extensions not built: if you installed already verify that you 
are not importing from the source directory

the thing that i really don't understand is that in the shell window if i type 
import statsmodels.tsa i don't get any error, also if i type the help funcion i 
can see that in the package there is the function stattools that i need

>>> import statsmodels.tsa
>>> help(statsmodels.tsa)
Help on package statsmodels.tsa in statsmodels:

NAME
    statsmodels.tsa

FILE
    c:\python27\lib\site-packages\statsmodels\tsa\__init__.py

PACKAGE CONTENTS
    adfvalues
    api
    ar_model
    arima_model
    arima_process
    arma_mle
    base (package)
    descriptivestats
    filters (package)
    interp (package)
    kalmanf (package)
    mlemodel
    setup
    stattools
    tests (package)
    tsatools
    varma_process
    vector_ar (package)
I will really appreciate your help
thanks in advance,

Eva

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to