I have a data frame df, of the form:
Col1 Col2 Col3
0 0 1 0
1 1 1 0
2 0 1 1
3 1 1 0
I need a new df of the form:
Col1 Col2 Col3
Col1 0 2 0
Col2 2 0 1
Col3 0 1 0
Basically the values represent the co-occurrences of two given columns for all rows.
How do I go about this?