Skip to content

Instantly share code, notes, and snippets.

@yuyasugano
Created September 24, 2020 11:27
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 yuyasugano/fb0dc19bf4ed0e4ea836e52b6db978d0 to your computer and use it in GitHub Desktop.
Save yuyasugano/fb0dc19bf4ed0e4ea836e52b6db978d0 to your computer and use it in GitHub Desktop.
Pandas rolling change for financial assets
%matplotlib inline
fig = plt.figure(figsize=(15, 7))
ax1 = fig.add_subplot(1, 1, 1)
rolling_pct_change.plot(ax=ax1)
ax1.set_xlabel('Date')
ax1.set_ylabel('21days rolling daily change')
ax1.set_title('21days rolling daily change of financial assets')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment