title: How to aggregate multiple columns in pandas groupby
body: <p>I have created a pandas dataframe mn using following input:</p>
  
  <pre><code>keyA     state n1    n2     d1  d2
  key1     CA   100   1000    1   2
  key2     FL   200   2000    2   4
  key1     CA   300   3000    3   6
  key1     AL   400   4000    4   8
  key2     FL   500   5000    5   2
  key1     NY   600   6000    6   4
  key2     CA   700   7000    7   6
  </code></pre>
  
  <p>Have created a sum object as follows :</p>
  
  <pre><code>s = mn.groupby(['keyA','state'], as_index=False).sum()
  </code></pre>
  
  <p>How do I iterate the sum object <code>s</code>, so I can get following output: </p>
  
  <p>The v1 column in the result below is computed as <code>s['n1']/s['d1']</code> </p>
  
  <p>The v2 column in the result below is computed as <code>s['n2']/s['d2']</code> </p>
  
  <pre><code>keyA state  v1  v2
  'key1','AL',100,500
  'key1','CA',100,500
  'key1','NY',100,1500
  'key2','CA',100,1166
  'key2','FL',100,1166
  </code></pre>