text_html_output_1.png
from sklearn.preprocessing import MinMaxScaler

import numpy as np

import pandas as pd

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(1)

data = pd.read_csv('../input/AAPL.csv')

data['Date'] = pd.to_datetime(data['Date'])

X = np.array(data['Open'])
X = X.reshape(X.shape[0], 1)
X.shape

from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler(feature_range=(0, 1))
X = scaler.fit_transform(X)

tp = 20
train = X[:1150]
test = X[1150 - tp:]

print(train.shape, '\n', test.shape)