Skip to content

Instantly share code, notes, and snippets.

@sid321axn
Created August 26, 2020 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sid321axn/bf417840d7d22da4cbf2aa641637d25c to your computer and use it in GitHub Desktop.
Save sid321axn/bf417840d7d22da4cbf2aa641637d25c to your computer and use it in GitHub Desktop.
#setting the split date
split_date = pd.Timestamp('26-08-2018')
# creating training dataframe
train = df.loc[:split_date]
# creating test dataframe
test = df.loc[split_date:]
#plotting train test dataframe as aline plot
ax = train.plot(kind='line',figsize=(12,8))
test.plot(ax=ax,kind='line',figsize=(12,8))
plt.legend(['train', 'test'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment