Below is a example of my data set. I want to combine duplicated points together and get the sum of values in columns a , b and c into a single row.
I have looked at a previous example using groupby.sum()
here How do I Pandas group-by to get sum?. Because I am dealing with geometries I can't get my code to work.
geometry | a | b | c |
---|---|---|---|
point a | 2 | 4 | 6 |
point a | 3 | 1 | 7 |
point b | 1 | 2 | 3 |
This is want I want:
geometry | a | b | c |
---|---|---|---|
point a | 5 | 5 | 13 |
point b | 1 | 2 | 3 |