Suppose we have the following dataframe with multiple values for a certain column:
categories
0 - ["A", "B"]
1 - ["B", "C", "D"]
2 - ["B", "D"]
How can we get a table like this?
"A" "B" "C" "D"
0 - 1 1 0 0
1 - 0 1 1 1
2 - 0 1 0 1
Note: I don't necessarily need a new dataframe, I'm wondering how to transform such DataFrames to a format more suitable for machine learning.