Let's say I have an ND array in python represented by the following scheme:
["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]]
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:
[[1, 0, 750]
[1, 1, 300]
[2, 0, 750]
[2, 1, 900]]