Here is a collection of notebooks I created over time on various topics.
Calculating cumulative returns of a stock with python and pandas