I am looking for an efficient solution to do the following using Python Pandas dataframes:
Iris-setosa Iris-versicolor Iris-virginica
Iris-setosa 4 0 0
Iris-versicolor 0 1 3
Iris-virginica 0 0 7
merge/sum with:
Iris-setosa Iris-versicolor Iris-virginica
Iris-setosa 6 0 0
Iris-versicolor 0 2 2
Iris-virginica 0 0 5
For the end result of:
Iris-setosa Iris-versicolor Iris-virginica
Iris-setosa 10 0 0
Iris-versicolor 0 3 5
Iris-virginica 0 0 12
My actual confusion matrices are much larger so I am looking for an efficient solution.
I have tried brute force going through each index of each matrix and summing them together, but that is very inelegant and I would like to learn a faster way.