亲爱的先生/妈妈,
我正在执行时间序列分析模型。
我导入了“来自statsmodels.tsa.stattools import adfuller”,昨天工作正常。
但是今天当我尝试执行相同的代码时,它给了我以下错误。
我试图重新安装numpy和scipy但仍未解决。
请你帮我解决这个问题。
ImportError Traceback(最近一次调用最后一次)
在()
6来自pandas import DataFrame
7从matplotlib导入pyplot作为plt
----> 8来自statsmodels.tsa.stattools导入adfuller
〜/ .local / lib / python3.6 / site-packages / statsmodels / tsa / stattools.py in()
15来自statsmodels.tsa.adfvalues导入mackinnonp,mackinnoncrit
16来自statsmodels.tsa._bds导入bds
---> 17来自statsmodels.tsa.arima_model导入
ARMA
18来自statsmodels.tools.sm_excep
tions import InterpolationWarning,MissingDataError
19
〜/ .local / lib / python3.6 / site-packages / statsmodels / tsa / arima_model.py in()
14来自scipy import optimize
15来自scipy.stats导入t,规范
---> 16来自scipy.signal import lfilter
17来自numpy import dot,log,zeros,pi
18来自numpy.linalg import inv
/glob/intel-python/versions/2018/intelpython3/lib/python3.6/site-packages/scipy/signal/__init__.py in()
307来自.ltisys import *
308来自.lti_conversion import *
- > 309来自.windows导入*
310来自.signaltools进口*
来自._savitzky_golay的311导入savgol_coeffs,savgol_filter
/glob/intel-python/versions/2018/intelpython3/lib/python3.6/site-packages/scipy/signal/windows.py in()
五
6导入numpy为np
----> 7来自scipy import fftpack,linalg,special
8来自scipy._lib.six import string_types
9
/glob/intel-python/versions/2018/intelpython3/lib/python3.6/site-packages/scipy/fftpack/__init__.py in()
98来自.pseudo_diffs import *
99来自.helper import *
- > 100来自.fft_intel import __fft,__ ftt2,__ fttn,__ ifft,__ ifft2,__ ifftn
101
102 __fft .__ doc__ = fft .__ doc__
/glob/intel-python/versions/2018/intelpython3/lib/python3.6/site-packages/scipy/fftpack/fft_intel.py in()
1
2来自numpy import half,float32,asarray,ndarray,longdouble,float64
----> 3来自numpy.fft导入fft_为numpy_fft_
4来自numpy.fft导入ifft_为numpy_ifft_
5来自numpy.fft导入fftn_为numpy_fftn_
ImportError:无法导入名称'fft_'
谢谢,
Yogalakshmi。
以上来自于谷歌翻译
以下为原文
Dear Sir/Mam,
I am executing a time series analysis model. I had imported "from statsmodels.tsa.stattools import adfuller", it was working fine yesterday. But today when I try to execute the same code, it is giving me the below error. I tried to reinstall the numpy and scipy but still not resolved. Kindly request you to help me resolve the same.
ImportError Traceback (most recent call last)
in ()
6 from pandas import DataFrame
7 from matplotlib import pyplot as plt
----> 8 from statsmodels.tsa.stattools import adfuller
~/.local/lib/python3.6/site-packages/statsmodels/tsa/stattools.py in ()
15 from statsmodels.tsa.adfvalues import mackinnonp, mackinnoncrit
16 from statsmodels.tsa._bds import bds
---> 17 from statsmodels.tsa.arima_model import ARMA
18 from statsmodels.tools.sm_exceptions import InterpolationWarning, MissingDataError
19
~/.local/lib/python3.6/site-packages/statsmodels/tsa/arima_model.py in ()
14 from scipy import optimize
15 from scipy.stats import t, norm
---> 16 from scipy.signal import lfilter
17 from numpy import dot, log, zeros, pi
18 from numpy.linalg import inv
/glob/intel-python/versions/2018/intelpython3/lib/python3.6/site-packages/scipy/signal/__init__.py in ()
307 from .ltisys import *
308 from .lti_conversion import *
--> 309 from .windows import *
310 from .signaltools import *
311 from ._savitzky_golay import savgol_coeffs, savgol_filter
/glob/intel-python/versions/2018/intelpython3/lib/python3.6/site-packages/scipy/signal/windows.py in ()
5
6 import numpy as np
----> 7 from scipy import fftpack, linalg, special
8 from scipy._lib.six import string_types
9
/glob/intel-python/versions/2018/intelpython3/lib/python3.6/site-packages/scipy/fftpack/__init__.py in ()
98 from .pseudo_diffs import *
99 from .helper import *
--> 100 from .fft_intel import __fft, __fft2, __fftn, __ifft, __ifft2, __ifftn
101
102 __fft.__doc__ = fft.__doc__
/glob/intel-python/versions/2018/intelpython3/lib/python3.6/site-packages/scipy/fftpack/fft_intel.py in ()
1
2 from numpy import half, float32, asarray, ndarray, longdouble, float64
----> 3 from numpy.fft import fft_ as numpy_fft_
4 from numpy.fft import ifft_ as numpy_ifft_
5 from numpy.fft import fftn_ as numpy_fftn_
ImportError: cannot import name 'fft_'
Thanks,
Yogalakshmi.