Skip to content

Instantly share code, notes, and snippets.

Created December 23, 2020 07:10
What would you like to do?
df['Return'] = df['USD (PM)'].pct_change() * 100
df['Lagged_Return'] = df.Return.shift()
df = df.dropna()
train = df['2001':'2018']
test = df['2019']
# Create train and test sets for dependent and independent variables
X_train = train["Lagged_Return"].to_frame()
y_train = train["Return"]
X_test = test["Lagged_Return"].to_frame()
y_test = test["Return"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment