Like this:
import numpy as np
a = np.zeros((3,3))
b = np.ones((3,1))
a[:,2] += b
expected:
a =
0,0,1
0,0,1
0,0,1
in fact:
ValueError: non-broadcastable output operand with shape (3,) doesn't match the broadcast shape (3,3)
What should I do?