I wonder what would be the most efficient way to form the cooccurrence matrix in python if you have two list of tuples and their counts, like:
l1 = [(a, b, c, d), (b, c, d), (d, a)]
l2 = [(one, two), (two, three), (one)]
counts = [3, 7, 4]
And then, the outcome should be like this:
# one two three
# a 7 3 0
# b 3 10 7
# c 3 10 7
# d 7 10 7
However, actual matrices (lists of tuples) and resulting matrix can be quite large.
Many thanks!