How to forecast the column value based on its previous value in Python
Consider that
(1) exp(x+y) == exp(x)*exp(y).
And
(2) exp(log(x)) == x.
So exp(log(c1) + b2) == c1 * exp(b2).
The next value simplifies to c1 * exp(b2) * exp(b3), and so on.
That means, you have to multiply all exp(b) values, which can be turned
into adding all(b)-s and then applying exp() to the result.
And don't forget to multiply it with a1, the initial value.
a1 * exp(b2 * b3 * ...)
I have a dataframe with 3,000,000 IDs. Each ID has the month range from 2015-01-01 
t0 2018-12-01. Each ID has column "A" and "B" with numeric values. I need to create a new column "C:. 
For each ID, when Date == '2015-01-01' which is the first month for that ID, column C value equal to exp(column_A value).
 For the next month (Date == '2015-02-01'), column C value equal to exp(log(column_C_value in previous month) + column_B_value at this month), so here is exp(log(column C @ 2015-01-01) + column_B @ 2015-02-01). Each of the following months has the same pattern until it reaches 2018-12-01.
In Python, I can setup the loop for each ID and for each row/month, such as:
for ID in range(xxx):
    for month in range(xxxx):
However, such calculation takes long time. Can anyone tell me a faster way to do this calculation? Very appreciated for your help!