Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- from statsmodels.tsa.seasonal import seasonal_decompose
- import matplotlib.pyplot as plt
- data = pd.read_csv('/datasets/energy_consumption.csv', index_col=[0], parse_dates=[0])
- data.sort_index(inplace=True)
- data = data['2018-01-01':'2018-01-15'].resample('1D').sum()
- decomposed = seasonal_decompose(data)
- decomposed.seasonal.plot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement