In numpy, how can I join the entries that intersects at a cell?
For example:
In the example, I want to join rows/columns B and F into one row/column BF, where each element is the average of the ones with the same color.
In numpy, how can I join the entries that intersects at a cell?
For example:
In the example, I want to join rows/columns B and F into one row/column BF, where each element is the average of the ones with the same color.
What you want to do doesn't seem straightforward from a matrix point of view so doing in a "pure numpy" manner is likely unfeasible.
I'd probably break it up into 2 or 3 operations: