I have a data frame that has the following data
Country Order Nr.
0 SU 123123
1 SU 235235
2 SU 442342
3 SU 545435
4 UA 656565
5 UA 142371
6 UA 142377
I need to merge all the "Order Nr." into a single row based on the country. The type of data in "Order Nr." is int while in "Country" it's a string
I have tried the following code but it does not seem to work for me
df.groupby('Order Nr.')[''].apply(' '.join).reset_index()
I get "sequence item 0: expected str instance, int found"
I need it to be in a data frame so that I can later convert them into an HTML and send it as an email. The expected output should be as follows:
Country Order Nr.
0 SU 123123,235235,442342,545435
1 UA 656565,142371,142377
Please can anyone help
Thanks in Advance