Is there a numpy operator that will result in the individual vector element multiplying with the corresponding matrix row?
For e.g.,
import numpy
a,b=numpy.array([1,2]), numpy.array([[1,2,3,4],[5,6,7,8]])
When I multiply a and b, I want the result to be
[[1,2,3,4],[10,12,14,16]]
where each vector element is multiplied with the corresponding matrix row elements.
I know how to implement this using loops, but I just wanted to know whether an in-built function exists in numpy for this, especially when b is an extremely large, but sparse matrix?
Thank you.