title: Pandas: Dealing with Boolean in Pivot Table
body: <p>Having a real mind blank right now.</p>
  
  <p>I have a DataFrame in the format <code>[userid],[q1],[q2],[q3],[q4]</code> (Each q. column is dtype boolean).</p>
  
  <pre><code>   q1    q2     q3    q4     userid
  0  True  False  True  False  1
  1  True  True   False False  2
  2  False False  True  True   3
  3  True  True   True  True   4
  4  False False  True  True   5
  5  True  True   False False  6 
  </code></pre>
  
  <p>I'm having a heck of a time trying to figure out how to pivot or groupby the values without having to do this individually for each column.</p>
  
  <p><code>df['q1'].value_counts()</code> will return values as expected:</p>
  
  <pre><code>False    7138
  True     2768
  dtype: int64
  </code></pre>
  
  <p>I'd like to get to this, and I can't quite get there:</p>
  
  <pre><code>        q1    q2    q3
  True    600   45    700
  False   245   800   145
  </code></pre>
  
  <p>Not sure if I need to convert the boolean to int, or if I am missing a transform or a map step.</p>
  
  <p>Any help appreciated!</p>