title: How to sum column values with python
body: <p>I have a rowset that looks like this:</p>
  
  <pre><code>defaultdict(&lt;type 'dict'&gt;, 
  {
     u'row1': {u'column1': 33, u'column2': 55, u'column3': 23}, 
     u'row2': {u'column1': 32, u'column2': 32, u'column3': 17}, 
     u'row3': {u'column1': 31, u'column2': 87, u'column3': 18}
  })
  </code></pre>
  
  <p>I want to be able to easily get the sum of column1, column2, column3. It would be great if I could do this for any number of columns, receiving the result in a hash map that looks like <code>columnName =&gt; columnSum</code>. As you might guess, its not possible for me to obtain the summed values from the database in first place, thus the reason to ask the question.</p>