'Multiply row with upper row in a column of DataFrame (Python)

I have a dataframe below and I want to add another column called "CUMULATIVE". To get the value of that column you need to just multiply [DAILY]row(x) * [DAILY]row(x-1). In excel it is pretty simple, because you only need to paste formula "=A2*A1" in the the second row and just drag it down. But it is getting hard for me to repeat it in python. Do you have any ideas how to do it ?

I used the below line but it is not correct, because because it multiplicates with each above rows, instead of with just 2 rows nearby.

df['cumprod'] = df.groupby('TICKER')['MNOZNIK_DZIENNY'].cumprod()

enter image description here



Solution 1:[1]

Well, I came up with the solution few seconds after I published my question :) Using SHIFT in Python should do the job, but if you have other possibilites in mind be free to type!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 fasola195