How to change this data frame
Index_Value Value
value_1 1
value_1 2
value_1 3
value_2 33
value_3 111
value_3 222
to
Index_Value Value Counter
value_1 1 1
value_1 2 2
value_1 3 3
value_2 33 1
value_3 111 1
value_3 222 2
using pandas. I start to implement this using for loops but for large data set performance can be very poor.