Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dickey Fuller failure
#1
When I run the Dickey-Fuller test as shown here:

# 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)
I get a successful run on most sensors. But on sensor_03 it fails. The error is now shown:

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
Reply


Messages In This Thread
Dickey Fuller failure - by Led_Zeppelin - Sep-13-2022, 03:54 PM
RE: Dickey Fuller failure - by deanhystad - Sep-13-2022, 04:29 PM
RE: Dickey Fuller failure - by Led_Zeppelin - Sep-13-2022, 05:19 PM
RE: Dickey Fuller failure - by deanhystad - Sep-13-2022, 05:55 PM
RE: Dickey Fuller failure - by Led_Zeppelin - Sep-15-2022, 09:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Failure to run source command middlestudent 2 727 Sep-22-2023, 01:21 PM
Last Post: buran
  Statsmodels, Dickey-Fuller test for stationarity Led_Zeppelin 1 973 Aug-17-2022, 06:36 PM
Last Post: Larz60+
  Assert failure jtcostel 1 1,663 Sep-03-2021, 05:28 PM
Last Post: buran
  xml decoding failure(bs4) roughstroke 1 2,293 May-09-2020, 04:37 PM
Last Post: snippsat
  SCIKIT learn failure in mac Perja11 1 2,325 Nov-30-2019, 06:44 PM
Last Post: snippsat
  failure to find modules justus123 2 4,279 Dec-14-2018, 04:28 PM
Last Post: nilamo
  LIB install failure Able98 2 3,946 Jun-07-2017, 06:41 PM
Last Post: Able98

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020