a = np.array([[ 5, 1 ,3], [ 1, 1 ,1], [ 1, 2 ,1]]) b = np.array([1, 2, 3]) print a.dot(b) array([16, 6, 8])
Here is what the above code is Doing:
1. The first line creates a numpy array called a.
2. The second line creates a numpy array called b.
3. The third line prints the result of the dot product of a and b.