title: How to sum a column grouped by other columns in a list?
body: <p>I have a list as follows.</p>
  
  <pre><code>[['Andrew', '1', '9'], ['Peter', '1', '10'], ['Andrew', '1', '8'], ['Peter', '1', '11'], ['Sam', '4', '9'], ['Andrew', '2', '2']]
  </code></pre>
  
  <p>I would like sum up the last column grouped by the other columns.The result is like this</p>
  
  <pre><code>[['Andrew', '1', '17'], ['Peter', '1', '21'], ['Sam', '4', '9'], ['Andrew', '2', '2']]
  </code></pre>
  
  <p>which is still a list.</p>
  
  <p>In real practice, I would always like to sum up the last column grouped by many other columns. Is there a way I can do this in Python? Much appreciated.</p>