[Numpy-discussion] array vector elementwise multiplication

Gideon Simpson simpson@math.toronto....
Tue Feb 3 11:19:45 CST 2009

I have an M x N matrix A and two vectors, an M dimensional vector x  
and an N dimensional vector y.  I would like to be able to do two  

1.  Multiply, elementwise, every column of A by x

2.  Multiply, elementwise, every row of A by y.

What's the "quick" way to do this in numpy?


More information about the Numpy-discussion mailing list