title: Get pairs of values satisfying condition based on mutual connection pandas
body: <p>Let's say I have following dataframe:</p>
  <pre><code>     index    A      B
       -----------------
        1      A1     B1
        2      A1     B2
        3      A1     B3
        4      A2     B1
  </code></pre>
  <p>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.</p>
  <p>In this case it should return (A1, B1) because A1 is connected with 3 different Bs, but B1 is connected with 2 different As.</p>