title: Pandas DataFrame aggregate function using multiple columns
body: <p>Is there a way to write an aggregation function as is used in <code>DataFrame.agg</code> method, that would have access to more than one column of the data that is being aggregated? Typical use cases would be weighted average, weighted standard deviation funcs.</p>
  
  <p>I would like to be able to write something like</p>
  
  <pre><code>def wAvg(c, w):
      return ((c * w).sum() / w.sum())
  
  df = DataFrame(....) # df has columns c and w, i want weighted average
                       # of c using w as weight.
  df.aggregate ({"c": wAvg}) # and somehow tell it to use w column as weights ...
  </code></pre>