I have a rowset that looks like this:
defaultdict(<type 'dict'>,
{
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}
})
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 columnName => columnSum. 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.