I have a python data from as below. in every row I have some similar "string", in every round of similar string, I want to merge the first one with the first, then the first one with second one, then the first one with the third, can anyone help me please?
row label
1 x a
2 x bb
3 x cc
4 x rr
5 x uu
6 y ff
7 y bb
8 y nn
I want :
0 x a
1 x abb
2 x acc
3 x arr
4 x auu
5 y ff
6 y ffbb
7 y ffnn