I am trying to figure out how to do some kind of scalar matrix multiplication in numpy.
I have
a = array(((1,2,3),(4,5,6))) b = array((11,12))
and i want to do
a op b
will result in
array(((1*11,2*11,3*11),(4*12,5*12,6*12))
right now i am using the following expression
c = a * array ((b, b, b)). transpose ()
There seems to be a more efficient way to do this, though
source share