title: How to sum an ND array in python based on like entries?
body: <p>Let's say I have an ND array in python represented by the following scheme:</p>
  
  <pre><code>["Event ID", "Event Location", "Event Cost"]
  data = \
  [[1, 0, 500]
  [1, 0, 250]
  [1, 1, 300]
  [2, 0, 750]
  [2, 1, 400]
  [2, 1, 500]]
  </code></pre>
  
  <p>How can I collapse this array to sum up the cost for entries with the same event ID that happened in the same event location? This would give me the following array at the end:</p>
  
  <pre><code>[[1, 0, 750]
  [1, 1, 300]
  [2, 0, 750]
  [2, 1, 900]]
  </code></pre>