I have a Dataframe like this:
Name
foo
foo
bar
foo
bar
shoo
shoo
foo
bar
bar
I want to add the position of occurrence in the next column, something like Serialized Name
Expected Output:
Name Serialized Name
foo foo-1
foo foo-2
bar bar-1
foo foo-3
bar bar-2
shoo shoo-1
shoo shoo-2
foo foo-4
bar bar-3
bar bar-4
My approach was to get the unique values of the column list(df['Name'].unique()) and their count list(df['Name'].value_counts()) but I am not exactly sure how to proceed