title: Apply multiple functions to multiple groupby columns
body: <p>The <a href="http://pandas.pydata.org/pandas-docs/dev/groupby.html#applying-multiple-functions-at-once" rel="noreferrer">docs</a> show how to apply multiple functions on a groupby object at a time using a dict with the output column names as the keys:</p>
  <pre><code>In [563]: grouped['D'].agg({'result1' : np.sum,
     .....:                   'result2' : np.mean})
     .....:
  Out[563]: 
        result2   result1
  A                      
  bar -0.579846 -1.739537
  foo -0.280588 -1.402938
  </code></pre>
  <p>However, this only works on a Series groupby object. And when a dict is similarly passed to a groupby DataFrame, it expects the keys to be the column names that the function will be applied to.</p>
  <p>What I want to do is apply multiple functions to several columns (but certain columns will be operated on multiple times). Also, <em>some functions will depend on other columns in the groupby object</em> (like sumif functions). My current solution is to go column by column, and doing something like the code above, using lambdas for functions that depend on other rows. But this is taking a long time, (I think it takes a long time to iterate through a groupby object). I'll have to change it so that I iterate through the whole groupby object in a single run, but I'm wondering if there's a built in way in pandas to do this somewhat cleanly.</p>
  <p>For example, I've tried something like</p>
  <pre><code>grouped.agg({'C_sum' : lambda x: x['C'].sum(),
               'C_std': lambda x: x['C'].std(),
               'D_sum' : lambda x: x['D'].sum()},
               'D_sumifC3': lambda x: x['D'][x['C'] == 3].sum(), ...)
  </code></pre>
  <p>but as expected I get a KeyError (since the keys have to be a column if <code>agg</code> is called from a DataFrame).</p>
  <p>Is there any built in way to do what I'd like to do, or a possibility that this functionality may be added, or will I just need to iterate through the groupby manually?</p>