image_output_1.png
from sklearn.preprocessing import MinMaxScaler

import matplotlib.pyplot as plt

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

prices_dataset = pd.read_csv('../input/prices.csv', header=0)
prices_dataset

wltw = prices_dataset[prices_dataset['symbol'] == 'WLTW']
wltw.shape

wltw_stock_prices = wltw.close.values.astype('float32')
wltw_stock_prices = wltw_stock_prices.reshape(-1, 1)
scaler = MinMaxScaler(feature_range=(0, 1))
wltw_stock_prices = scaler.fit_transform(wltw_stock_prices)

train_size = int(len(wltw_stock_prices) * 0.67)
test_size = len(wltw_stock_prices) - train_size
train, test = (wltw_stock_prices[0:train_size, :], wltw_stock_prices[train_size:len(wltw_stock_prices), :])
print(len(train), len(test))