when to use numpy dot code example
Example 1: numpy.dot
>>> a = [[1, 0], [0, 1]]
>>> b = [[4, 1], [2, 2]]
>>> np.dot(a, b)
array([[4, 1],
[2, 2]])
Example 2: numpy dot product
a = np.array([1,2,3])
b = np.array([4,5,6])
np.dot(a,b)
32
>>> a = [[1, 0], [0, 1]]
>>> b = [[4, 1], [2, 2]]
>>> np.dot(a, b)
array([[4, 1],
[2, 2]])
a = np.array([1,2,3])
b = np.array([4,5,6])
np.dot(a,b)
32