0

Just need a quick gut check. I am checking for seasonality using seasonal decompose function. I have close to two years worth of daily data. I believe my frequency should be 365 but would love a second opinion.

from statsmodels.tsa.seasonal import seasonal_decompose
from matplotlib import pyplot

df.reset_index(inplace=True)
df.date = pd.to_datetime(df.date)
df.set_index('date',inplace=True)
result_add = seasonal_decompose(df[['rev'], model='additive', freq=365)
result_add.plot()
pyplot.show()

I wanted to confirm my thinking was correct. Current the plot with the code above shows a trend but no seasonality line.

Any second opinions would be appreciated.

  • Can you pass `'freq=1Y'` instead of 365? Leap year has 366 days, but if you are checking for seasonality, shouldn't it be `1` or `'freq=1d'`? Hope this link helps: https://stackoverflow.com/questions/47609537/seasonal-decompose-in-python – David Erickson Sep 30 '20 at 00:44
  • I read that link. It's a little confusing. Seems like its trying to do the same thing as I but isn't clear as well. – Michael Lamontagne Sep 30 '20 at 01:35

0 Answers0