I have a dataframe like below and I'm trying to split the repeated unique_id rows into new columns.
unique_id Name Description_col
001 Ram description1
002 Kumar description2
002 Gopal description3
003 Dinesh description4
004 Avi description5
004 Sam description6
004 Guru description7
I am trying to split the dataframe by grouping by unique_id. If the unique id is repeated then the Name, Description columns should be added as new columns.
My expected output is:
unique_id Name Description_col Name2 Description_col2 Name3 Description_col3
001 Ram description1
002 Kumar description2 Gopal description3
003 Dinesh description4
004 Avi description5 Sam description6 Guru description7