title: Find customers with at least 5 transactions - looking for a tidier way to do this
body: <p>I have a dataframe with customer transactions:</p>
  <pre><code>   customer_id  transaction_amount
  0          bob                  12
  1          bob                  34
  2          bob                  56
  3          bob                  23
  4         mary                  12
  5         mary                  34
  6         mary                   3
  7         mary                  53
  8         mary                  23
  9         mary                  12
  10        mary                   5
  11         jim                   2
  12         jim                   5
  </code></pre>
  <p>I want to find customers with at least 5 transactions.</p>
  <p>What I'm doing works, but it looks very messy. It's a very ugly groupby</p>
  <p>I groupby <code>customer_id</code>, count the <code>transaction_amount</code>.</p>
  <pre><code>df.groupby('customer_id')['transaction_amount'].count()
  
  customer_id
  bob     4
  jim     2
  mary    7
  </code></pre>
  <p>Then I create a mask using the same groupby, but I add the filter <code>&gt;=5</code> , then get the <code>index</code> of the result.</p>
  <pre><code>
  mask = (df.groupby('customer_id')['transaction_amount'].count()&gt;=5)
  
  df.groupby('customer_id')['transaction_amount'].count()[mask].index
  
  </code></pre>
  <p>This gives me my result:</p>
  <pre><code>Index(['mary']
  </code></pre>
  <p>Surely there's a tidier way to do this? Two groupbys on top of eachother just feels wrong.</p>
  <p>This is an operation I do a lot in work, so I'd like to know if it can be tidier or more &quot;pythonic&quot; I guess.</p>