title: Retain DataFrame's index when using groupby apply to generate Series
body: <p>When calling a function using <code>groupby</code> + <code>apply</code>, I want to go from a <code>DataFrame</code> to a <code>Series</code> groupby object, apply a function to each group that takes a <code>Series</code> as input and returns a <code>Series</code> as output, and then assign the output from the <code>groupby</code> + <code>apply</code> call as a field in the <code>DataFrame</code>.
  The default behavior is to have the output from <code>groupby</code> + <code>apply</code> indexed by the grouping fields, which prevents me from assigning it back to the <code>DataFrame</code> cleanly. I'd prefer to have the function I call with apply take a <code>Series</code> as input and return a <code>Series</code> as output; I think it's a bit cleaner than <code>DataFrame</code> to <code>DataFrame</code>. (This isn't the best way of getting to the result for this example; the real application is pretty different.)</p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame({
   'A': [999, 999, 111, 111],
   'B': [1, 2, 3, 4],
   'C': [1, 3, 1, 3]
  })
  def less_than_two(series):
    # Intended for series of length 1 in this case
    # But not intended for many-to-one generally
    return series.iloc[0] &lt; 2
  output = df.groupby(['A', 'B'])['C'].apply(less_than_two)
  </code></pre>
  
  <p>I want the index on <code>output</code> to be the same as <code>df</code>, otherwise I cant assign
      to <code>df</code> (cleanly):</p>
  
  <pre><code>df['Less_Than_Two'] = output
  </code></pre>
  
  <p>Something like <code>output.index = df.index</code> seems too ugly, and using the <code>group_keys</code> argument doesn't seem to work:</p>
  
  <pre><code>output = df.groupby(['A', 'B'], group_keys = False)['C'].apply(less_than_two)
  df['Less_Than_Two'] = output
  </code></pre>