How to convert a set of categories into a DataFrame?
For example:
A = [{'a', 'c'}, {'a', 'b'}, {'b', 'd'}, {'e'}]
To:
'a', 'b', 'c', 'd', 'e'
1 1 , 0 , 1 , 0 , 0
2 1 , 1 , 0 , 0 , 0
3 0 , 1 , 0 , 1 , 0
4 0 , 0 , 0 , 0 , 1