I have a pandas dataframe like,
pd.DataFrame({'f1':[23,56,7, 56,34, 98],
'f2':[32,85,27, 36,64, 60]})
f1 f2
0 23 32
1 56 85
2 7 27
3 56 36
4 34 64
5 98 60
and based on an index list like index_list = [2, 4] I want to add a new column to original datafram like following,
new_column f1 f2
0 0 23 32
1 0 56 85
2 0 7 27
3 1 56 36
4 1 34 64
5 2 98 60
Note: index list shows the locations that new_column should increase 1 integer up.