0

I tried following a tutorial on how to get trends via pandas but I go the error message after I try to show the trends: ValueError: You must specify a freq or x must be a pandas object with a timeseries index with a freq not set to None

this is my code

import pandas as pd
import datetime
df = pd.read_csv('Sealevel.csv')

df['Time'] = pd.to_datetime(df['Time']
df = df.set_index('Time')

%matplotlib inline

import statsmodels.api as sm 

test = sm.tsa.seasonal_decompose(df, model='additive')
fig = test.plot()

nucsit026
  • 652
  • 7
  • 16
Woody
  • 35
  • 3
  • 1
    Does this answer your question? [Time Series Analysis - unevenly spaced measures - pandas + statsmodels](https://stackoverflow.com/questions/34494780/time-series-analysis-unevenly-spaced-measures-pandas-statsmodels) – E. Zeytinci Jan 16 '20 at 20:15
  • 1
    @E.Zeytinci YES, Thank you very much :) – Woody Jan 16 '20 at 20:18

0 Answers0