I have a non-uniform list as follows:
[['E', 'A', 'P'],
['E', 'A', 'X', 'P'],
['E', 'A', 'P'],
['P'],
['E', 'A', 'X', 'P'],
['E', 'A', 'P'],
['A', 'X', 'P'],
['E', 'A', 'P'],
['E', 'A', 'P'],
['E', 'A', 'X', 'P'],
['E', 'A', 'P'],
['E', 'A', 'P'],
['A', 'X', 'P'],
I would like to create a data frame from this, where each column represents the four possible letters "E", "A", "X" and "p" in a one-hot encoded manner - what is the most efficient way to go about this?
Try:
Prints: