January 2020
Beginner to intermediate
432 pages
11h 24m
English
Execute the following steps to carry out the time series decomposition.
import pandas as pdimport quandlfrom statsmodels.tsa.seasonal import seasonal_decompose
QUANDL_KEY = '{key}' # replace {key} with your own API key quandl.ApiConfig.api_key = QUANDL_KEYdf = quandl.get(dataset='WGC/GOLD_MONAVG_USD', start_date='2000-01-01', end_date='2011-12-31')df.rename(columns={'Value': 'price'}, inplace=True)df = df.resample('M').last()
There are some duplicate values in the series. For example, there is an entry for 2000-04-28 and 2000-04-30, both with the same value. To deal with this issue, we resample to monthly data by only taking ...
Read now
Unlock full access