I have a dataframe like this
import pandas as pd
d={'x':[8,5,6,7],
'cord':['(3,0)','(2,0)','(6,0)','(1,0)']}
df=pd.DataFrame.from_dict(d)
I would like to create df['y'] which will have the first 'cord' value and shift to get index value.
cord x y
0 (3,0) 8 1 #Index 3, First value in (1,0)
1 (2,0) 5 6 #Index 2, First value in (6,0)
2 (6,0) 6 NaN #Index 6, does not exist, NaN
3 (1,0) 7 2 #Index 1, First value (1,0)