Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def buildTrain(train, pastDay=30, futureDay=5):
- X_train, Y_train = [], []
- for i in range(train.shape[0]-futureDay-pastDay):
- X_train.append(np.array(train.iloc[i:i+pastDay]))
- Y_train.append(np.array(train.iloc[i+pastDay:i+pastDay+futureDay]["Adj Close"]))
- return np.array(X_train), np.array(Y_train)
Add Comment
Please, Sign In to add comment