title: Python Pandas Dataframe: user-defined function in groupby to merge columns
body: <p>Is it possible to use in <code>groupby</code> a user-defined function that will be passed as arguments values of several columns, every column in a separate argument? In the following 'standard' example <code>sum</code> function is called on<code>v1</code> and <code>v2</code> columns separately:   </p>
  
  <pre><code>In [110]: dct = {
       ...:     'id':[1,2,2,3,3,3],
       ...:     'vl':[1,1,1,1,1,1],
       ...:     'v2':[2,2,2,2,2,2]
       ...: }
       ...:
       ...: df = pd.DataFrame(dct)
       ...: df.groupby('id')['vl','v2'].sum()
       ...:
  Out[110]:
  vl  v2
  id
  1    1   2
  2    2   4
  3    3   6
  </code></pre>
  
  <p>How to define <code>mysum</code> function with two arguments, with each argument to get it's own column something like:</p>
  
  <pre><code>def f(col1, col2):                                                                                          
      return  col1 * 2 + col2 * 3
  </code></pre>
  
  <p>So, in fact, this function merges two columns in one. Can this be done?</p>