title: Group By & Aggregate List of Dictionaries in Python
body: <p>I have a list of dictionaries which I need to aggregate in Python:</p>
  
  <pre><code>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}]
  </code></pre>
  
  <p>and I'm looking to aggregate based on budgetImpressions.</p>
  
  <p>So the final result should be: </p>
  
  <pre><code>data = [{"startDate": 123, "endDate": 456, "campaignName": "abc", "campaignCfid": 789, "budgetImpressions": 60}, 
  {"startDate": 456, "endDate": 789, "campaignName": "def", "campaignCfid": 123, "budgetImpressions": 80}]
  </code></pre>
  
  <p>Note every entry with a certain campaignName will always have the same corresponding campaignCfid, startDate and endDate.</p>
  
  <p>Can this be done in Python? I've tried using itertools without much success. Would it be a better approach to use Pandas? </p>