title: Python pandas: mean and sum groupby on different columns at the same time
body: <p>I have a pandas dataframe which looks like the following:</p>
  
  <pre><code>Name    Missed    Credit    Grade
  A       1         3         10
  A       1         1         12      
  B       2         3         10
  B       1         2         20
  </code></pre>
  
  <p>And my desired output is:</p>
  
  <pre><code>Name    Sum1   Sum2    Average
  A       2      4      11
  B       3      5      15   
  </code></pre>
  
  <p>Basically to get the sum of column <code>Credit</code> and <code>Missed</code> and to do average on <code>Grade</code>. What I am doing right now is two groupby on <code>Name</code> and then get sum and average and finally merge the two output dataframes which does not seem to be the best way of doing this. I have also found this on SO which makes sense if I want to work only on one column:</p>
  
  <pre><code>df.groupby('Name')['Credit'].agg(['sum','average'])
  </code></pre>
  
  <p>But not sure how to do a one-liner for both columns?   </p>