I'm adding the counter to the end of the unique rows but unable to do.I have 4 columns namely "ID", "Name","Amount".The problem I'm facing is that i want to add counter at the end of unique row "Id" column but make sure that i am also considering other unique rows as well.
This is the data frame i am using.
Amount ID Name
0 110 c121 abc
1 120 c121 abc
2 120 c123 sdd
3 140 c124 eet
df = {'ID':['c121', 'c121', 'c123', 'c124'], 'Name':['abc', 'abc','sdd','eet'],'Amount':[110,120,120,140]}
df = pd.DataFrame(df)
current df
Amount ID Name
0 110 c121 abc
1 120 c121 abc
2 120 c123 sdd
3 140 c124 eet
Expected result:
Amount ID Name
0 110 c121_1 abc
1 120 c121_2 abc
2 120 c123 sdd
3 140 c124 eet