Dot multiplication of matrix

I do not understand how come the result of . operator is 30 here when I write below command.
a = np.array([1,2,3,4])
b = np.array([1,2,3,4])

print(a)
print(b)
print(a.dot(b))

why the data in matrix a is all stuffed in a row and b has all the data in column. who decides how the data would be arranged in the matrix.

Hey @indrabijaynarayan, this is the special property of numpy arrays. When you apply dot product on two 1D vectors, then it returns the inner product of the two vectors. You can refer this link for more detailed information.

Hope this helps !
Happy Learning :slight_smile: