Let's say I have following dataframe:
index A B
-----------------
1 A1 B1
2 A1 B2
3 A1 B3
4 A2 B1
How do I write a code that returns these pairs (Ax,By) that satisfy such condition that Ax is connected with more different Bs than By is connected with different As.
In this case it should return (A1, B1) because A1 is connected with 3 different Bs, but B1 is connected with 2 different As.