I encountered a problem in create a sparse indicator matrix.
Let me describe my problem in brief.
Suppose I have a list of categories:
cate = ["a", "b", "c", "d", "e"]
a matrix in each of whose row contains a subset of category:
mat = [["a","c"],["b"],["c","d","e"]]
I want to get a sparse indicator matrix(could be a DataFrame):
result = [[1,0,1,0,0],[0,1,0,0,0],[0,0,1,1,1]]
If it could be derived by pandas operations, that could never be more cool!