title: Count where Column is True, Grouped By Another in Pandas
body: <p>Given a DataFrame like this:</p>
  
  <pre><code>dft = pd.DataFrame([[12, 'Bob', True], 
                     [123, 'Henry', False], 
                     [768, 'Bob', False]], 
                     columns=['TID', 'UID', 'TRUTH'])
  </code></pre>
  
  <p>Which looks like this:</p>
  
  <pre><code>   TID    UID  TRUTH
  0   12    Bob   True
  1  123  Henry  False
  3  768    Bob  False
  </code></pre>
  
  <p>I want to aggregate over <code>UID</code> and count where <code>TRUTH</code> is True.  So the output should look like:</p>
  
  <pre><code>     UID  TRUTH
  0    Bob      1
  1  Henry      0
  </code></pre>
  
  <p>I have already tried:</p>
  
  <pre><code> dft.groupby('UID').agg({'TRUTH': pd.Series.nunique})  # counts all values T and F
  </code></pre>
  
  <p>I am conceptually struggling to see how to put the condition together with the aggregation.</p>
  
  <p>Thanks for your help!</p>