title: Pandas groupby: combine distinct values into another column
body: <p>I need to group by a subset of columns and count the number of distinct combinations of their values. However, there are other columns that may or may not have distinct values, and I want to somehow retain this information in my output. Here is an example:  </p>
  
  <pre><code>gb1          gb2         text1   text2
  bebop        skeletor    blue    fisher
  bebop        skeletor    blue    wright
  rocksteady   beast_man   orange  haldane
  rocksteady   beast_man   orange  haldane
  tokka        kobra_khan  green   lande
  tokka        kobra_khan  red     arnold
  </code></pre>
  
  <p>I <strong>only</strong> want to group by <code>gb1</code> and <code>gb2</code>. </p>
  
  <p>Here is what I need:</p>
  
  <pre><code>gb1          gb2         count   text1        text2
  bebop        skeletor    2       blue         fisher, wright
  rocksteady   beast_man   2       orange       haldane
  tokka        kobra_khan  2       green, red   lande, arnold
  </code></pre>
  
  <p>I've got everything working except for handling the <code>text1</code> and <code>text2</code> columns.</p>
  
  <p>Thanks in advance.</p>