I have dataframe like below
A,B,C,D
91102,1,john,
91102,2,john,
91102,3,john,
91102,1,,mary
91102,2,,mary
91102,3,,mary
91103,1,sarah,
91103,2,sarah,
91103,3,sarah,
91103,1,,khan
91103,2,,khan
91103,3,,khan
and I want groupby column A and column B and want get desired output like below

A,B,C,D
91102,1,john,mary
91102,2,john,mary
91102,3,john,mary
91103,1,sarah,khan
91103,2,sarah,khan
91103,3,sarah,khan
I tried below but not giving desired output
df=df.groupby(['A', 'B'], as_index=False).agg('' .join)

df.to_dict()and post the result here to give us an easier time reconstructing your dataframe?