How do i create a dataframe which first cell has a different pandas formula from the subsequent cells?
From the above, The first cell of the Ave Gain is simply the average of the first 2 gains: (1.84 + 0) / 2 = 0.92. Similarly for first cell of the Ave Loss : (0.07 + 0) / 2 = 0.035
However the second cell of the Ave Gain is the previous Ave Gain (0.92) + the new Gain (1.62) divided by 2 : (0.92+1.62) /2 = 1.27
and the third cell is the previous Ave Gain (1.27) + the new gain (1.61) divided by 2: = (1.27+1.61) / 2 = 1.44
1)How should i go about creating a dataframe which first cell has a different formula from the subsequent cells?
2)How do i create a recursive table for the Ave Gain (it uses its own previous value to calculate the next value)
Thank you