title: How to group by a single column in pandas and expand unique values with agg count?
body: <p>For anyone stumbling across a similar problem, this answered my question: <a href="https://stackoverflow.com/questions/15259547/conditional-sums-for-pandas-aggregate">conditional sums for pandas aggregate</a></p>
  <p>I've had success doing a normal groupby on data like this...</p>
  <pre><code>score |  type     |
  --------------------
  1     |  type1    |
  3     |  type6    |
  5     |  type4    |
  3     |  type21   |
  2     |  type3    |
  4     |  type1    |
  ...etc...
  </code></pre>
  <p>ideal output</p>
  <p>That resulted in something like this...</p>
  <pre><code>score |  type     |
  --------------------
  5     |  882    |
  4     |  183    |
  3     |  458    |
  2     |  1156   |
  1     |  10934  |
  </code></pre>
  <p>But I want to be able to take the unique values of the &quot;type&quot; column into account and end up with something more like this...</p>
  <pre><code>score | type1 | type 2 | type 3 ... etc.
  ------------------------------        
  5     |   20  |    4   |   ..  |
  4     |    3  |    17  |   ..  |
  3     |    1  |    12  |   ..  |
  2     |   14  |    9   |   ..  |
  1     |   70  |    13  |   ..  |
  </code></pre>
  <p>I'm not sure if a groupby is the right approach but I've been banging my head against this and need help.</p>