Sorry if this is too simple a question, but is there a sumif function in python that will sum by identifier and category? So in this case, I would like to have a function sumif which takes as arguments the identifier and the year and sums the amount. For example sumif('105','2006') should return 1200.
data = {'105':[{'2005': 500}, {'2005', 13000}, {'2006', 100}, {'2006', 200}, {'2006', 900}], '256': [{'2005', 5000}, {'2005', 800}]}
Therefore the definition of
sumifwould be: