title: pandas groupby on multiindex levels: group_keys
body: <p>I have a DataFrame whose columns are MultiIndex.
  I want to groupby one level of the columns and use apply to perform a transformations.</p>
  
  <p><strong>Goal: I want that the DataFrame passed to the function using apply does <em>not</em> have the keys of groupby in the index.</strong></p>
  
  <p>From the <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.groupby.html" rel="nofollow noreferrer">docs</a> it looks like this is what <code>group_keys</code> is doing, but it seems to have no effect:</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  
  data = {'A': pd.DataFrame(np.random.randn(100, 5)),
          'B': pd.DataFrame(np.random.randn(100, 5)),
          'C': pd.DataFrame(np.random.randn(100, 5))}
  
  data = pd.concat(data, axis=1, names=['feat_1', 'feat_2'])
  
  def foo(df):
      print(df.columns)
      return df.sum(1)
  </code></pre>
  
  <p>My attempt:</p>
  
  <pre><code>result = data.groupby(level=['feat_1'], axis=1, group_keys=False).apply(foo)
  </code></pre>
  
  <p>This is what is printed on screen:</p>
  
  <pre><code>MultiIndex(levels=[['A', 'B', 'C'], [0, 1, 2, 3, 4]],
             labels=[[0, 0, 0, 0, 0], [0, 1, 2, 3, 4]],
             names=['feat_1', 'feat_2'])
  MultiIndex(levels=[['A', 'B', 'C'], [0, 1, 2, 3, 4]],
             labels=[[1, 1, 1, 1, 1], [0, 1, 2, 3, 4]],
             names=['feat_1', 'feat_2'])
  MultiIndex(levels=[['A', 'B', 'C'], [0, 1, 2, 3, 4]],
             labels=[[2, 2, 2, 2, 2], [0, 1, 2, 3, 4]],
             names=['feat_1', 'feat_2'])
  </code></pre>
  
  <p>Desired output of print: I would like the function <code>foo</code>to receive a dataframe with only <code>feat_2</code> as columns, given I am using <code>group_keys=False</code></p>
  
  <pre><code>[0, 1, 2, 3, 4]
  [0, 1, 2, 3, 4]
  [0, 1, 2, 3, 4]
  </code></pre>
  
  <p>Am I missing something from the documentation? Or how can I achieve what I want (possibly without modifying the function foo)?</p>
  
  <p>Note: I am using pandas 0.20.3 on Python 3</p>