Code
# Import the function
from statsmodels.tsa.stattools import adfuller
# Assume 'y' is a pandas Series or NumPy array
# The most common test includes a constant ('c')
result = adfuller(y, regression='c', autolag='AIC')
# Print the key results
print(f'ADF Statistic: {result[0]}')
print(f'p-value: {result[1]}')
# result[1] is the p-value.
# To test with a constant and trend, use regression='ct'



