I have a data-frame which looks like:
A B C
13.06 12.95 -0.11
92.56 104.63 12.07
116.49 219.27 102.78
272.11 487.26 215.15
300.11 780.75 480.64
There are like 1 million records.
I want to create a column D which is calcualted as below:
First value of column D
will be 0 and then:
Col D3
= =(D2+1)*C3/B3
Col D4
= =(D3+1)*C4/B4
Column D present value depends on previous value.
Here is the result:
D
0
0.115358884
0.52281017
0.672397915
1.02955022
I can solve it using for loop and loc
but its taking lot of time. Can I solve it in more effective pythonic way?