title: Pandas - List out data columns in new columns using Groupby
body: <p>I need to add new columns based on the groupby results. Take the following dataframe for exampe.</p>
  
  <pre><code> ID      City      
   234x    Lima
   342x    Rica
   234x    Rio
   333x    NYC
   333x    SF
  </code></pre>
  
  <p>I have been about to use group_by to get the counts:</p>
  
  <pre><code>df_GroupBy = pd.DataFrame({'count':df.groupby([ "ID"]).size()}).reset_index()
  </code></pre>
  
  <p>This gives an output:</p>
  
  <pre><code> ID       Count
  234x       2
  342x       1
  333x       2
  </code></pre>
  
  <p>What I would like to do now is get this output:</p>
  
  <pre><code> ID       City     City_2
  234x       Lima     Rio
  342x       Rica      
  333x       NYC      SF
  </code></pre>
  
  <p>I have looked at both <code>Transform</code> and <code>map</code> but without much success. Thanks for your help.</p>