I have a binary matrix which have the following structure
df = pd.DataFrame({"col1": [0,1,0,1,1],
"col2": [1,0,1,0,0],"col3": [1,1,1,0,1],"col4": [1,0,0,1,0]},index=['a', 'b', 'c', 'd', 'e'])
And I am applying some similarity measure(jaccard distance) to each row and I want to have this type of item-item matrix by the end(the intersections values should comes from jaccard
function\not actual values used here). Final outcome should be like this.
a b c d e
a 0 3 2 1 1
b 0 1 2 3
c 0 1 4
d 0 2
e 0
I have the jaccard similarity function defined as jaccard()
I only want to know how to apply it to df
so that I can have this type of representation matrix by the end. Thank You!