I'm having trouble editing values in a numpy array
import numpy as np
foo = np.ones(10,10,2)
foo[row_criteria, col_criteria, 0] += 5
foo[row_criteria,:,0][:,col_criteria] += 5
row_criteria and col_criteria are boolean arrays (1D). In the first case I get a
"shape mismatch: objects cannot be broadcast to a single shape" error
In the second case, += 5 doesn't get applied at all. When I do
foo[row_criteria,:,0][:,col_criteria] + 5
I get a modified return value but modifying the value in place doesn't seem to work...
Can someone explain how to fix this? Thanks!