0

How to convert a unique values in column into seperate columns and updating the row value from another column?

For example I have the below df,

enter image description here

I want to convert the above dataframe into the below format. Is it possible?

enter image description here

Stramzik
  • 297
  • 3
  • 19
  • Please add any code you might have tried already. – 0buz Feb 11 '20 at 19:26
  • `df.pivot_table(index = 'ID', columns = 'Role', values = 'Email', aggfunc = ','.join).reset_index().rename_axis(columns = None)` – ansev Feb 11 '20 at 19:28

0 Answers0