title: concise way of flattening multiindex columns
body: <p>Using more than 1 function in a groupby-aggregate results in a multi-index which I then want to flatten.</p>
  
  <p>example: </p>
  
  <pre><code>df = pd.DataFrame(
      {'A': [1,1,1,2,2,2,3,3,3],
       'B': np.random.random(9),
       'C': np.random.random(9)}
  )
  out = df.groupby('A').agg({'B': [np.mean, np.std], 'C': np.median})
  
  # example output
  
            B                   C
         mean       std    median
  A
  1  0.791846  0.091657  0.394167
  2  0.156290  0.202142  0.453871
  3  0.482282  0.382391  0.892514
  </code></pre>
  
  <p>Currently, I do it manually like this</p>
  
  <pre><code>out.columns = ['B_mean', 'B_std', 'C_median']
  </code></pre>
  
  <p>which gives me the result I want</p>
  
  <pre><code>     B_mean     B_std  C_median
  A
  1  0.791846  0.091657  0.394167
  2  0.156290  0.202142  0.453871
  3  0.482282  0.382391  0.892514
  </code></pre>
  
  <p>but I'm looking for a way to automate this process, as this is monotonous, time consuming and allows me to make typos as I rename the columns.</p>
  
  <p>Is there a way to return a flattened index instead of a multi-index when doing a groupby-aggregate?</p>
  
  <p>I need to flatten the columns to save to a text file, which will then be read by a different program that doesn't handle multi-indexed columns.</p>