title: pandas - check for non unique values in dataframe groupby
body: <p>I have this simple dataframe <code>df</code>:</p>
  
  <pre><code>a,b
  1,2
  1,3
  1,4
  1,2
  2,1
  2,2
  2,3
  2,5
  2,5
  </code></pre>
  
  <p>I would like to check whether there are duplicates in <code>b</code> with respect to each group in <code>a</code>. So far I did the following:</p>
  
  <pre><code>g = df.groupby('a')['b'].unique()
  </code></pre>
  
  <p>which returns:</p>
  
  <pre><code>a
  1       [2, 3, 4]
  2    [1, 2, 3, 5]
  </code></pre>
  
  <p>But what I would like to have is a list, for each group in <code>a</code>, with multiple occurrences in <code>b</code>. The expected output in this case would be:</p>
  
  <pre><code>a
  1    [2]
  2    [5]
  </code></pre>