a guest Oct 19th, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- from matplotlib import pyplot
- from statsmodels.tsa.seasonal import seasonal_decompose
- # Input dataframe df has prices under the column name 'close'
- series = pd.DataFrame(data=df['close'].values, index=pd.to_datetime(df.index), columns = ['close']).dropna()
- result = seasonal_decompose(series.values, model='multiplicative', freq=30)
RAW Paste Data