I have a dataframe such as the following:
Index Return
2008-11-21 0.153419
2008-11-24 0.037421
2008-11-25 0.077500
What's the best way to calculate a cumulative return across all columns on the last row?
Following is the intended result:
Index Return
2008-11-21 0.153419
2008-11-24 0.037421
2008-11-25 0.077500
Cumulative 0.289316
Where cumulative return calculated as follows:
cumulative = (1 + return1) * (1 + return2) * (1 + return3) - 1
What is the best way to perform this in pandas?