title: Pandas groupby multiple columns with values of unique groupings as their own column
body: <p>Example Dataframe =</p>
  <pre><code>df = pd.DataFrame({'ID': [1,1,2,2,2,3,3,3],
  ...                'Type': ['b','b','b','a','a','a','a']})
  </code></pre>
  <p>I would like to return the counts grouped by ID and then a column for each unique ID in Type and the count of each Type for that grouped row:</p>
  <pre><code>pd.DataFrame({'ID': [1,2,3],'Count_TypeA': [0,2,3], 'CountTypeB':[2,1,0]}, 'TotalCount':[2,3,3])
  </code></pre>
  <p>Is there an easy way to do this using the groupby function in pandas?</p>