In python library numpy, is array([2,1]) (1,2) or (2,1)_(row,col)?
I made 3 tries below but couldn't find the answer.
import numpy as np
x = np.array([1,2])
y = np.array([[1,3,5], [2,4,6]])
z = np.array([[1,2],[3,4],[5,6]])
o = np.array([1,2,3])
print(np.dot(x,y))
print(np.dot(z,x))
print(np.dot(x,o))
The first and second one worked but the last one didn't. The error is:-
ValueError: shapes (2,) and (3,) not aligned: 2 (dim 0) != 3 (dim 0)
In my opinion, in case 1, x = (1 row and 2 col) in case 2, x = (2 row and 1 col) in case 3, x should be (2 row and 1 col) but it didn't worked
Please let me know why this happened.
np.dot(x,o)?