Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Dec 23, 2020
Embed
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