title: Pandas: Sort before aggregate within a group
body: <p>I have the following Pandas dataframe:</p>
  
  <pre><code>A        B         C
  A        A         Test1
  A        A         Test2
  A        A         XYZ
  A        B         BA
  A        B         AB
  B        A         AA
  </code></pre>
  
  <p>I want to group this dataset twice: First by A and B to concate the group within C and afterwards only on A to get the groups defined solely by column A. The result looks like this:</p>
  
  <pre><code>A        A        Test1,Test2,XYZ
  A        B        AB, BA
  B        A        AA
  </code></pre>
  
  <p>And the final result should be:</p>
  
  <pre><code>A        A,A:(Test1,Test2,XYZ), A,B:(AB, BA)
  B        B,A:(AA)
  </code></pre>
  
  <p>Concatenating itself works, however the sorting does not seem work.</p>
  
  <p>Can anyone help me with this problem?</p>
  
  <p>Kind regards.</p>