I am learning numpy linear algerba, and I want to perform a simple calculation: I have:
m = np.array([[1,2],
[3,4],
[5,6]]
v = np.array([10,20,30])
what I want to calculate/output:
[ [1/10, 2/10],
[3/20, 4/20],
[5/30, 6/30]]
basically to perform a element-wise division between each row of m and each element of v
I can probably do that via some for loop, but I'd like to know the "proper" ways of doing it.
I am sensing it has something to do with the broadcasting but that's it.
Thanks.