I want to perform a break down to a pandas column similarly to the question:
I want to transpose and then "one-hot-encode" style. For example, taking dataframe df
Col1 Col2
C {Apple, Orange, Banana}
A {Apple, Grape}
B {Banana}
I would like to convert this and get:
df
Col1 C A B
Apple 1 1 0
Orange 1 0 0
Banana 1 0 1
Grape 0 1 0
How can I use pandas/Sklearn to achieve this?