Looking for advice on the best way to perform the following operation. Preferably in python, javascript, or excel. Data is in CSV (although I removed the commas below). I'm a noob; I should be able to do it, but I'm thinking there's an elegant way to do something like this since it is such a basic operation.
Direction Name Trial Amount
+ Matthew 1 500
- Matthew 1 250
- Matthew 1 250
+ Matthew 2 1000
- Matthew 2 750
+ Matthew 3 500
+ Mark 1 500
- Mark 1 250
+ Luke 1 1000
+ Luke 2 1000
+ Luke 3 1000
- Luke 2 500
Net each amount by name and trial (large number of trials in dataset).
Result would be:
Direction Name Trial Amount
+ Matthew 2 250
+ Matthew 3 500
+ Mark 1 250
+ Luke 1 1000
+ Luke 2 500
+ Luke 3 1000
Thanks in advance!