Sep-13-2022, 03:54 PM
(This post was last modified: Sep-13-2022, 03:59 PM by Led_Zeppelin.)
When I run the Dickey-Fuller test as shown here:
I get a successful run on most sensors. But on sensor_03 it fails. The error is now shown:
Please explain this error.
Thanks in advance.
Respectfully,
LZ
1 2 3 4 5 6 7 8 |
# dickey-fuller test dft = adfuller (image_data_org[ 'sensor_04' ], autolag = 'AIC' ) # dickey fuller test output dfo = pd.Series(dft[ 0 : 4 ], index = [ 'Test Statistic' , 'p-value' , 'Lags Used' , 'Observations Used' ]) for key,value in dft[ 4 ].items(): dfo[ 'Critical Value (%s)' % key] = value print (dfo) |
Output:alueError Traceback (most recent call last)
Input In [61], in <cell line: 2>()
1 # dickey-fuller test
----> 2 dft = adfuller (image_data_org['sensor_04'], autolag='AIC')
3 # dickey fuller test output
4 dfo = pd.Series(dft[0:4], index=['Test Statistic','p-value','Lags Used','Observations Used'])
File ~\miniconda3\envs\pump-failure-pred\lib\site-packages\statsmodels\tsa\stattools.py:260, in adfuller(x, maxlag, regression, autolag, store, regresults)
165 def adfuller(
166 x,
167 maxlag: int | None = None,
(...)
171 regresults=False,
172 ):
173 """
174 Augmented Dickey-Fuller unit root test.
175
(...)
258 See example notebook
259 """
--> 260 x = array_like(x, "x")
261 maxlag = int_like(maxlag, "maxlag", optional=True)
262 regression = rename_trend(regression)
File ~\miniconda3\envs\pump-failure-pred\lib\site-packages\statsmodels\tools\validation\validation.py:147, in array_like(obj, name, dtype, ndim, maxdim, shape, order, contiguous, optional)
145 if arr.ndim != ndim:
146 msg = "{0} is required to have ndim {1} but has ndim {2}"
--> 147 raise ValueError(msg.format(name, ndim, arr.ndim))
148 if shape is not None:
149 for actual, req in zip(arr.shape, shape):
ValueError: x is required to have ndim 1 but has ndim 2
I have no idea what this error means or how to correct it.Please explain this error.
Thanks in advance.
Respectfully,
LZ