I need a help in calculating profit/loss percentage. I have a data frame as follows
Date Price
2017-5-20 50
2017-5-20 60
2017-5-20 45
I need a new column in dataframe which calculates profit or loss percentage of consecutive rows, such as
Date Price Prof/Loss
2017-5-20 50 0
2017-5-20 60 16.66
2017-5-20 45 -23.07