image_output_1.png
from statsmodels.tsa.seasonal import seasonal_decompose

from statsmodels.tsa.stattools import adfuller

import pandas as pd

df = pd.read_csv('/kaggle/input/monthly-milk-production-pounds/monthlyMilkProduction.csv')
df.columns = ['Month', 'Production/Cow']
df = df[:-1]
df['Month'] = pd.to_datetime(df['Month'])
df.set_index('Month', inplace=True)

from statsmodels.tsa.seasonal import seasonal_decompose
result = seasonal_decompose(df, model='additive')

from statsmodels.tsa.stattools import adfuller
result = adfuller(df)
print(f'ADF Statistic: {result[0]}')
print(f'p-value: {result[1]}')