November 2017
Intermediate to advanced
304 pages
6h 58m
English
Here, we will download the data from the sources mentioned in the codes variable, and we will put them into our closings data frame. We will store the original data, scaled data, and the log_return:
codes = ["WSE/OPONEO_PL", "WSE/VINDEXUS", "WSE/WAWEL", "WSE/WIELTON", "WIKI/SNPS"]
closings = pd.DataFrame()
for code in codes:
code_splits = code.split("/")
stock_exchange = code_splits[0]
index = code_splits[1]
stock_data = requests.get(base_url.format(stock_exchange, index)).json()
dataset_data = stock_data['dataset_data']
data = np.array(dataset_data['data'])
closings[index] = pd.Series(data[:, 1].astype(float))
closings[index + "_scaled"] = closings[index] / max(closings[index]) closings[index + "_log_return"] ...Read now
Unlock full access