I have a table like so:
Name | ID | Contact_method | Contact
sarah 1 house h1
sarah 1 mobile m1
sarah 1 email sarah@mail
bob 2 house h2
bob 2 mobile m2
bob 2 email bob@mail
jones 3 house h3
jones 3 mobile m3
jones 3 email jones@mail
jones 4 house h4
jones 4 mobile m4
jones 4 email jones2@mail
And I want it like so:
Name | ID | house | mobile | email
sarah 1 h1 m1 sarah@mail
bob 2 h2 m2 bob@mail
jones 3 h3 m3 jones@mail
jones 4 h4 m4 jones2@mail
I can already do this, but only through a very expensive pd.concat operation iterated over all the unique IDs. Is there a simple way to do this? I've also tinkered with pivot() and transpose(). Note that the duplicate name is there so that I can't rely on uniqueness of column values to, say, do a join.