I need to order duplicates in my data frame with a counter value of 1, 2 , 3 etc. The input data frame is like below:
Key Amount
xyz 1000
xyz1 870
xyz2 1000
xyz3 1000
xyz4 650
and expected output as
Key Amount Duplicate_order
xyz 1000 1
xyz1 870 1
xyz2 1000 2
xyz3 1000 3
xyz4 650 1