alimanfoo/petl — pull request #193 by shayh (2013-05-05 07:21:46+00:00)
Title: support for multiple source columns in multiple aggregations

>>> # aggregate multiple fields
... from collections import OrderedDict
>>> aggregation = OrderedDict()
>>> aggregation['count'] = len
>>> aggregation['minbar'] = 'bar', min
>>> aggregation['maxbar'] = 'bar', max
>>> aggregation['sumbar'] = 'bar', sum
>>> aggregation['listbar'] = 'bar' # default aggregation function is list
>>> aggregation['foosandbars'] = ['foo', 'bar'], list
>>> table5 = aggregate(table1, 'foo', aggregation)
>>> look(table5)