title: Pandas search for duplicate rows in one column which have different values in another column
body: <p>I have a Pandas dataframe <code>df</code> for which I want to find all rows for which the value of column <code>A</code> is the same, but the value of column <code>B</code> different, e.g.:</p>
  
  <pre><code>       | A | B
      ---|---|---
       0 | 2 | x 
       1 | 2 | y 
  </code></pre>
  
  <p>I know I can use <code>pd.concat(g for _, g in df.groupby('A') if len(g) &gt; 1)</code> to get the rows with duplicate values of <code>A</code>, but how do I add the second constraint?</p>