gaess, I Want to subtract the previous values and next value (previous - next) in one columns on Python dataframe. The example and the output like this :
This is the one column dataframe:
| Gross_reserve|
| ------------ |
0 | 1.202.170,21 |
1 | 1.190.721,39 |
2 | 1.179.354,33 |
3 | 1.131.377,18 |
4 | ... |
And then the output i want is make a new columns called "cf_res_g" with the value like this :
| Gross_reserve| cf_res_g |
| ------------ | -------- |
0 | 1.202.170,21 | 11.448,82|
1 | 1.190.721,39 | 11.367,06|
2 | 1.179.354,33 | 47.997,16|
3 | 1.131.377,18 | ... |
4 | ... | ... |
so, if we do calculation is like this: index[0] - index[1], index[1] - index[2], etc