Split single Dataframe Column into multiple columns

I have data along the lines below (although many more rows than the example of course). The data can appear in diferent order.

Col1
1xAAAA,2xBBBB
1xBBBB,1xAAAA
1xAAAA,1xCCCC

I want to split into numerical columns like this: (ultimately to get totals)

AAAA  BBBB  CCCC
1     2     0
1     1     0
1     0     1


Read more here: https://stackoverflow.com/questions/64378180/split-single-dataframe-column-into-multiple-columns

Content Attribution

This content was originally published by Wayne_AB at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: