Optimization of average calculation
I'm not sure if there really is a better way to do this. The best I could come up with is:

import itertools
from collections import Counter

def convDict(inDict):
    inDict['a'] = inDict['a'] * inDict['n']
    return Counter(inDict)

average = sum(itertools.imap(convDict, inData), Counter())
average['a'] = average['a'] / average['n']


But I'm still not sure if that is better than what you originally had.

Counter is a subclass of dict. You can get items from them the same way you get items from a normal dict. One of the most important differences is that the Counter will not raise an Exception if you try to select a non-existant item, it will instead return 0.