We instead use the dot function to compute inner products of vectors, to multiply a vector by a matrix, and to multiply matrices. dot is available both as a function in the numpy module and as an instance method of array objects: import numpy as np x = np.array([[1,2],[3,4]])...
In this example, we multiplied a 2-dimensional matrix by a 1-dimensional vector. (I.e., we multiplied a 2D Numpy a 1D Numpy array). When we do this, Numpy performs what is called “broadcasting.” Effectively, it takes the 1D vector, treats it as a row of data, and multiplies that...