[Numpy-discussion] how to multiply the rows of a matrix by a different number?

Jose Borreguero borreguero at gmail.com
Tue Mar 3 20:53:00 EST 2009


I guess there has to be an easy way for this. I have:
M.shape=(10000,3)
N.shape=(10000,)

I want to do this:
for i in range(10000):
M[i]*=N[i]
without the explicit loop


-Jose
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090303/c260eea5/attachment.html>


More information about the NumPy-Discussion mailing list