Here I have Open and Close Price of Stocks:
Open Close
1994.988 1994.988
2020.8496 2006.1270142499998
2050.030029 2017.3700764583332
2041.51001 2039.3920492708332
2062.52002 2057.9604493541665
2055.469971 2058.56656934375
2046.73998 2059.327636895833
Now I have to create a new column 'Percent_Change' that will be calculated as (Close - Open) / Open.
Calculations should be done on previous-day values so first row will be Nan then 0, and so on ...
Per_Change
NaN
0
-0.73%
-1.59%
-0.10%
-0.22%
0.15%
0.62%