title: Group and count unique values in Python pandas dataframe
body: <p>I have a dataframe of over 33,000 rows which I'd like to simplify:</p>
  
  <pre><code>                   Crime type
  GeographyCode                              
  E01006687          Burglary
  E01007229          Anti-social behaviour
  E01007229          Anti-social behaviour
  E01007229          Anti-social behaviour
  E01007229          Burglary
  E01007229          Other theft
  E01007229          Other theft
  E01007229          Shoplifting
  E01007229          Theft from the person
  E01007230          Anti-social behaviour
  E01007230          Anti-social behaviour
  E01007230          Anti-social behaviour
  E01007230          Anti-social behaviour
  E01007230          Anti-social behaviour
  E01007230          Anti-social behaviour
  ...
  </code></pre>
  
  <p>There are 207 unique values of 'GeographyCode' and 12 unique values of 'Crime type'.</p>
  
  <p>I'd like to make a new dataframe which has 207 rows and 12 columns plus the 'GeographyCode' index column, with each column representing a crime type, and containing a count of all occurances of that crime type within the GeographyCode.</p>
  
  <p>Something like this:</p>
  
  <pre><code>                Burglary   Anti-social    Theft   Shoplifting   etc...
  GeographyCode
  E01006687       1          3              9       5             ...
  E01007229       1          3              2       1             ...
  E01007230       0          6              12      5             ...
  ...
  </code></pre>
  
  <p>I've tried a few things, but because there are no numeric values I'm finding it really difficult to get what I need.</p>