Welcome Help.
I would like to merge multiple rows of each ID of a dataframe into a single cell, Below is input format:

I have the following list of columns and Dataframe in pandas respectively
dict1 = {'ID': ['6610', '6610', '6610', '6620', '6620', '7540', '7540'],
'NEW_ID': ['6615',
'6615',
'6615',
' ',
' ',
nan,
nan],
'OLD_PRICE': [17.22, 17.9, 17.22, 27.49, 20.42, 30.73, 29.55],
'NEW_PRICE': [17.22, 17.22, 27.49, 18.99, 27.49, 29.55, 27.49],
'LABEL': [' NaN1', ' NaN2', ' NaN4', nan, ' Na', 'A', 'B']}
df = pd.DataFrame(dict1)
Expected output:

You can find duplicates in
IDcolumn withpd.Series.duplicatedand fill the duplicates with blank value'':Prints:
NOTE: If you need strip whitespace characters from your dataframe elements you can use this code: