April 2019
Intermediate to advanced
426 pages
11h 13m
English
To find out how our portfolio has performed, we can sum its returns over a period of time. The cumsum method of pandas returns the cumulative sum over a DataFrame.
In the following example, we plot the cumulative sum of daily_changes of the ABN calculated previously:
In [ ]: df_cumsum = daily_changes.cumsum() df_cumsum.plot();
This gives us the following output graph:

Read now
Unlock full access