Hi :)
I'm trying to multiply two matrices that has different size.

-------------------------------------code-------------------------

import numpy as np

a = np.random.randn(4, 3)
b = np.random.randn(4, 1)

print a
print b

-------------------------------------code-------------------------

How should I multiply a and b so that the multipled matrix's size is 4*3?

I want to multiply matrix 'b' to each row of matrix 'a'.
So that if matrix a is
[[1, 2, 3],
  [2, 3, 4]]
and b is
[[2],
[3]]
a*b is
[[2, 4, 6],
  [4, 6 ,8]]

Plz help me!

if possible, plz use numpy
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to