I have a trouble with python broadcasting
there is two numpy list
x = np.array([[1,2,3],[4,5,6]])
y = np.array([0,1,1])
I'd like to calculate
x : [[1,2,3],
[4,5,6]]
to
x : [[1-y[0], 2-y[1], 3-y[2]],
[4-y[0], 5-y[1], 6-y[2]]]
that is,
x : [[0,-3,-3],
[3,0,0]]
at one time.
Please, let me know how to do that.
I'm sorry...i had a mistake....
i mean x : [[1,1,2], [4,4,5]]