I have a data frame as below -
df_add = pd.DataFrame({
'doc_id':[100,101,102,103],
'last_name':['Mallesham','Mallesham','Samba','Bhavik'],
'first_name':['Yamulla','Yamulla','Anil','Yamulla'],
'dob':['06-03-1900','06-03-1900','20-09-2020','09-16-2020']
})
Here doc_id 100 and 101 are duplicated rows on considering last, first names and DOB's.
Here My requirement is to roll up 101 to 100 as follows -
doc_id should be filled up as 100;101 with semicolon separator.
In a second case:
If I have just consider last_name and first_name combination it should display as below since a Same Name persons might have different DOB's