I have a dataframe as displayed below:
Transaction# ID
101 ABC
101 EFG
101 IJK
102 LMO
102 PQR
103 STU
I want to add one more column which will have values as mentioned below. Basically, it should write the column value as numbers starting from 1 to the number of times similar Transaction# is repeated.
Transaction# ID Number
101 ABC 1
101 EFG 2
101 IJK 3
102 LMO 1
102 PQR 2
103 STU 1