I have a similar dataframe to the next one:
Names | Case type | Number |
---|---|---|
Patrick | 10 | |
James | Phone | 78 |
Kerstin | 50 | |
James | 69 | |
Patrick | Phone | 48 |
Kerstin | Phone | 42 |
My idea is to expand Case type into another column so that each agent has email and phone assigned to their names and it only appears one:
Names | Type 1 | Number | Type 2 | Number |
---|---|---|---|---|
Kerstin | 50 | Phone | 42 | |
James | 69 | Phone | 78 | |
Patrick | 10 | Phone | 48 |
So far, I have tried using .groupby('Names') but this does not seem to work at all.
Is there anything that can be done? Another idea I had was to sort things by name and then split the dataframe into two dataframe and then merge them by agent? But it seems like there's something that could work better.
Thanks!