title: Python/Pandas: Unexpected indices when doing a groupby-apply
body: <p>I'm using Pandas and Numpy on Python3 with the following versions:</p>
  
  <ul>
  <li>Python 3.5.1 (via Anaconda 2.5.0) 64 bits</li>
  <li>Pandas 0.19.1</li>
  <li>Numpy 1.11.2 (probably not relevant here)</li>
  </ul>
  
  <p>Here is the minimal code producing the problem:</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  a = pd.DataFrame({'i' : [1,1,1,1,1], 'a': [1,2,5,6,100], 'b': [2, 4,10, np.nan, np.nan]})
  a.set_index(keys='a', inplace=True)
  v = a.groupby(level=0).apply(lambda x: x.sort_values(by='i')['b'].rolling(2, min_periods=0).mean())
  v.index.names
  </code></pre>
  
  <p>This code is a simple groupby-apply, but I don't understand the outcome:</p>
  
  <pre><code>FrozenList(['a', 'a'])
  </code></pre>
  
  <p>For some reason, the index of the result is ['a', 'a'], which seems to be a very doubtful choice from pandas. I would have expected a simple ['a'].</p>
  
  <p>Does anyone have some idea about why Pandas chooses to duplicate the column in the index?</p>
  
  <p>Thanks in advance.</p>