I'm new to NumPy, and I've encountered a problem with running some conditional statements on numpy arrays. Let's say I have 3 numpy arrays that look like this:
a:
[[0, 4, 4, 2],
 [1, 3, 0, 2],
 [3, 2, 4, 4]]
b:
[[6, 9, 8, 6],
 [7, 7, 9, 6],
 [8, 6, 5, 7]]
and, c:
[[0, 0, 0, 0],
 [0, 0, 0, 0],
 [0, 0, 0, 0]]
I have a conditional statement for a and b in which I would like to use the value of b (if the conditions of a and b are met) to calculate the value of c:
c[(a > 3) & (b > 8)]+=b*2
I get an error saying:
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
ValueError: non-broadcastable output operand with shape (1,) doesn't match the broadcast shape (3,4)
Any idea how I can accomplish this?
I would like the output of c to look as follows:
[[0, 18, 0, 0],
 [0, 0, 0, 0],
 [0, 0, 0, 0]]


