title: pandas groupby returns extra index
body: <pre class="lang-py prettyprint-override"><code>dft = pd.DataFrame({'C1': ['A','A','B','B'], 
                      'C2': [1,2,3,4]}) 
  
  def lam3(df):
      return pd.DataFrame({'X': ['C','D','E'], 
                      'Y': [11,22,33]})
  </code></pre>
  
  <p>Given the above dataframe and function (that I cannot change),I'd like to run groupby+apply so each group returns a dataframe, like this</p>
  
  <pre class="lang-py prettyprint-override"><code>    C1  C2  X   Y
  0   A   1   C   11
  1   A   1   D   22
  2   A   1   E   33
  3   A   2   C   11
  4   A   2   D   22
  5   A   2   E   33
  6   B   3   C   11
  7   B   3   D   22
  8   B   3   E   33
  9   B   4   C   11
  10  B   4   D   22
  11  B   4   E   33
  </code></pre>
  
  <p>Doing below gives an extra column of numered index:</p>
  
  <pre><code>dft.groupby(['C1','C2']).apply(lam3)
  </code></pre>
  
  <p>So I have to do the following to get what I want:</p>
  
  <pre><code>dft.groupby(['C1','C2']).apply(lam3).reset_index().drop(columns='level_2')
  </code></pre>
  
  <p>Apparently, this is not generic since level_2 depends on how many columns I use in the groupby and blindly dropping columns starting with "level" can potentially remove original columns. </p>
  
  <p>How to use a lambda function that returns a dataframe in groupby without returning the extra index?</p>
  
  <p>The question is similar to <a href="https://stackoverflow.com/questions/12410438/how-to-use-pandas-groupby-apply-without-adding-an-extra-index">this</a>, but each group here returns a dataframe, instead of a series.</p>
  
  <p><strong>EDIT:
  lam3 here is just an example function for demonstration. In the real version, there can be operations that depends on df. The point is that the lam3 function returns a dataframe in the context of groupby. So cross-join would not help</strong></p>