title: Pandas -- aggregating data into multiple columns
body: <p>I have a dataframe containing unaggregated data, like so:</p>
  
  <pre><code>df[['UniqueID ', 'SrvDesc']]
  
      UniqueID SrvDesc
  0   HEF104  Cash 
  1   HEF104  Credit
  2   HEF104  Deposit 
  3   HEF104  Ticket
  4   HEF104  Electronic
  5   HEF197  Check
  6   HEF197  Credit
  7   HEF198  Credit
  8   HEF198  Electronic
  9   HEF198  Check
  
  10 rows × 2 columns
  </code></pre>
  
  <p>As you can see, corresponding to each UniqueID, there are an arbitrary number of unique values for SrvDesc (HEF104 has 5 unique SrvDesc values, HEF198 has 3, etc.).</p>
  
  <p>What I'd like to do is perform some operation that will allow me to aggregate on UniqueID so that there is one row per UniqueID, and then any number of populated columns containing each of the values for SrvDesc for that given UniqueID:</p>
  
  <pre><code>    UniqueID SrvDesc_1  SrvDesc_2   SrvDesc_3   SrvDesc_4   SrvDesc_5
  0   HEF104   Cash       Credit      Deposit     Ticket      Electronic
  1   HEF197   Check      Credit
  2   HEF198   Credit     Electronic  Check
  </code></pre>
  
  <p>I've been looking into <code>pivot</code> and <code>unstack</code>, which seem very useful, but I'm not sure if they would allow me to accomplish exactly what I'm trying to do here.</p>
  
  <p>Thanks!</p>