Traceback (most recent call last):
File "C:\Users\A\Desktop\数模校赛(B题)\demo3.py", line 145, in <module>
stationary_after_diff = check_stationarity(df, f'{indicator}_diff')
File "C:\Users\A\Desktop\数模校赛(B题)\demo3.py", line 49, in check_stationarity
result = adfuller(data_series[column_name])
File "D:\Python\Python313\Lib\site-packages\statsmodels\tsa\stattools.py", line 326, in adfuller
icbest, bestlag = _autolag(
~~~~~~~~^
OLS, xdshort, fullRHS, startlag, maxlag, autolag
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "D:\Python\Python313\Lib\site-packages\statsmodels\tsa\stattools.py", line 132, in _autolag
mod_instance = mod(endog, exog[:, :lag], *modargs)
File "D:\Python\Python313\Lib\site-packages\statsmodels\regression\linear_model.py", line 921, in __init__
super().__init__(endog, exog, missing=missing,
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
hasconst=hasconst, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Python313\Lib\site-packages\statsmodels\regression\linear_model.py", line 746, in __init__
super().__init__(endog, exog, missing=missing,
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
weights=weights, hasconst=hasconst, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Python313\Lib\site-packages\statsmodels\regression\linear_model.py", line 200, in __init__
super().__init__(endog, exog, **kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Python313\Lib\site-packages\statsmodels\base\model.py", line 270, in __init__
super().__init__(endog, exog, **kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Python\Python313\Lib\site-packages\statsmodels\base\model.py", line 95, in __init__
self.data = self._handle_data(endog, exog, missing, hasconst,
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**kwargs)
^^^^^^^^^
File "D:\Python\Python313\Lib\site-packages\statsmodels\base\model.py", line 135, in _handle_data
data = handle_data(endog, exog, missing, hasconst, **kwargs)
File "D:\Python\Python313\Lib\site-packages\statsmodels\base\data.py", line 675, in handle_data
return klass(endog, exog=exog, missing=missing, hasconst=hasconst,
**kwargs)
File "D:\Python\Python313\Lib\site-packages\statsmodels\base\data.py", line 88, in __init__
self._handle_constant(hasconst)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "D:\Python\Python313\Lib\site-packages\statsmodels\base\data.py", line 134, in _handle_constant
raise MissingDataError('exog contains inf or nans')
statsmodels.tools.sm_exceptions.MissingDataError: exog contains inf or nans