title: Conditionally count values in a pandas groupby object
body: <p>I have a <code>pandas.core.groupby.DataFrameGroupBy</code> object where I am trying to count the number of rows where a value for <code>TOTAL_FLOOR_AREA</code> is <code>&gt; 30</code>. I can count the number of rows for each dataframe in the groupby object using:</p>
  
  <pre><code>import numpy as np
  
  grouped = master_lsoa.groupby('lsoa11')
  
  grouped.aggregate(np.count_nonzero).TOTAL_FLOOR_AREA
  </code></pre>
  
  <p>But how do I conditionally count rows where the value for <code>TOTAL_FLOOR_AREA</code> is greater than 30?</p>
  
  <p>Sam</p>