0

I have one df that looks like below:

id,type,content,code
1,short,contentShort1,123
1,long,contentLong,456
1,strong,content1long,789
2,short,contentShort2,123
2,long,contentLong,456
2,strong,strongcontent,123

I have more entries for the same id. I want to be able to split the df into the following:

id,shortContent,shortCode, longContent,longCode, strongContent, strongCode
1,contentShort1,123,contentLong,456,content1long,789
2,contentShort2,123,contentLong,456,strongcontent,123

which has one id per row. How can I split the dataframe, so that I have all the content related to the same id into one single row?

kitten_world
  • 65
  • 10

0 Answers0