Matrix A:
Count First Second
0.5 1 a
0.5 1 b
1.0 1 b
1.0 2 a
0.5 2 a
1.0 3 b
I need to create a new matrix from an original matrix by identifying all rows with matching "First" and "Second" values. Group these rows together and add the values in the "Count" Column. "Matrix B" would be the end result of running the code on "Matrix A":
NEW - Matrix B
Count First Second
0.5 1 a
1.5 1 b
1.5 2 a
1.0 3 b
Likely there is a simple method to perform this action. But I am at a loss right now. I currently working with a large numpy array.