title: Pandas: Get values from column that appear more than X times
body: <p>I have a data frame in pandas and would like to get all the values of a certain column that appear more than X times. I know this should be easy but somehow I am not getting anywhere with my current attempts.</p>
  
  <p>Here is an example:</p>
  
  <pre><code>&gt;&gt;&gt; df2 = pd.DataFrame([{"uid": 0, "mi":1}, {"uid": 0, "mi":2}, {"uid": 0, "mi":1}, {"uid": 0, "mi":1}])
  &gt;&gt;&gt; df2
  
      mi  uid
  0    1   0
  1    2   0
  2    1   0
  3    1   0
  </code></pre>
  
  <p>Now supposed I want to get all values from column "mi" that appear more than 2 times, the result should be</p>
  
  <pre><code>&gt;&gt;&gt; &lt;fancy query&gt;
  array([1])
  </code></pre>
  
  <p>I have tried a couple of things with groupby and count but I always end up with a series with the values and their respective counts but don't know how to extract the values that have count more than X from that:</p>
  
  <pre><code>&gt;&gt;&gt; df2.groupby('mi').mi.count() &gt; 2
  mi
  1      True
  2     False
  dtype: bool
  </code></pre>
  
  <p>But how can I use this now to get the values of mi that are true?</p>
  
  <p>Any hints appreciated :)</p>