Quantcast
Channel: Data Preparation & Blending discussions
Viewing all articles
Browse latest Browse all 4999

Split Comma-separated column into multiple columns

$
0
0

Hello, let's say I have a column that's formatted somewhat like:

 

column_name
A,B
B,C,D
A,D

 

I want to end up with:

column_namefoo_Afoo_Bfoo_Cfoo_D
A,BTrueTrueFalseFalse
B,C,DFalseTrueTrueTrue
A,DTrueFalseFalseTrue

 

This is somewhat like "one hot" encoding, except that each sample can have multiple values, each comma-separated.


Viewing all articles
Browse latest Browse all 4999

Trending Articles