I have a DataFrame like this:
colA colB
1 aaa
1 rrr
1 www
2 bbb
2 ccc
2 sss
...
I would like to convert the DataFrame as follows
colA Sum
1 wwwrrraaa
2 ssscccbbb
...
I tried
df.groupby(['colA'])['colB'].sum().reset_index()
but the sum of strings are reversed. Is there an elegant way to do this?