data = [{'startDate': 123, 'endDate': 456, 'campaignName': 'abc',
    'campaignCfid': 789, 'budgetImpressions': 10}, {'startDate': 123,
    'endDate': 456, 'campaignName': 'abc', 'campaignCfid': 789,
    'budgetImpressions': 50}, {'startDate': 456, 'endDate': 789,
    'campaignName': 'def', 'campaignCfid': 123, 'budgetImpressions': 80}]
g = groupby(data, lambda x: x.pop('campaignName'))
d = {}
Group By & Aggregate List of Dictionaries in Python