Entering edit mode
4.7 years ago
OdongoR89
•
0
Hello family! I have a dataframe like this:
n
ame members
x1 A,B,N,K,Y,G
x2 J,L,M,N,T
x3 G,H,S,J,D,F
x4 J,K,H,F,H,D,L
I want to perform pairwise comparison to find the number of common elements between any two rows like below:
name common name
x1 6 x1
x1 2 x2
x1 - x3
x1 - x4
x2 - x1
x2 5 - x2
x2 - x3
x2 - x4
x3 - x1
x3 - x2
x3 6 - x3
x3 - x4
x4 - x1
x4 - x2
x4 - x3
x4 7 -x4
I notice that the exact orientation of the dataframe is not writable in this workspace, but treat former as a 4by1 matrix and the later as a 16by3 matrix