1#We calculate and plot the cumulative return of a given dataframe called data
2r = data.pct_change()
3r_plus_one = r.add(1)
4cumulative_return = r_plus_one.cumprod().sub(1)
5cumulative_return.mul(100).plot()
6plt.ylabel('Percent')
7plt.legend(['Cumulative Return'])
8plt.show()