title: Convert an indexed pandas matrix to a flat dataframe
body: <p>Given the dataframe:</p>
  
  <pre><code>df = pd.DataFrame([['foo', 123, 4, 5, 0, 1], ['foo', 123, 4, 0, 9, 1], ['bar', 33, 0, 0, 3, 5]], columns=list('ABCDEF'))
  </code></pre>
  
  <p>[out]:</p>
  
  <pre><code>    A   B   C   D   E   F
  0   foo 123 4   5   0   1
  1   foo 123 4   0   9   1
  2   bar 33  0   0   3   5
  </code></pre>
  
  <p>The goal is to sum certain columns ('C', 'D', 'E', F') using other columns ('A' and 'B') as keys to achieve:</p>
  
  <pre><code>    A   B   C   D   E   F
  0   foo 123 8   5   9   2
  2   bar 33  0   0   3   5
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>df.groupby(['A', 'B']).sum()
  </code></pre>
  
  <p>[out]:</p>
  
  <pre><code>        C   D   E   F
  A   B               
  bar 33  0   0   3   5
  foo 123 8   5   9   2
  </code></pre>
  
  <p>How do I change it back to the non-indexed matrix? i.e.</p>
  
  <pre><code>    A   B   C   D   E   F
  0   foo 123 8   5   9   2
  2   bar 33  0   0   3   5
  </code></pre>