Remove special characters
It may be necessary to create a look up table where you have a key column and a value column but you cannot have duplicate key entries in your data, in which case you need to group the values together for each key. Here I will demonstrate how this is possible with a only a few simple lines of python code.
import pandas as pd
df=pd.read_excel('country.xlsx')
df
Finished data frame with comma separated rows.
df['COMPANYCODE'] = df['COMPANYCODE'].astype(str)
#Grouping the columns together
df.groupby('COUNTRY')['COMPANYCODE'].agg(','.join).reset_index()