I have a dataframe in below format
Col-1Col-2
a d1
a d2
x d3
a d4
f d5
a d6
a d7
I want to merge the values in col-2 by looking at consecutive duplicates in col1.We can see a has two occurrences of consecutive duplicates so.It should merge d1+d2 and d6+d7 separately.The datatype of these columns are strings,d1+d2 means concatenating string d1 with d2
The final output should be as shown below
Col-1Col-2
a d1+d2
x d3
a d4
f d5
a d6+d7