I´m trying to multiply each row of array A by each of all the rows in another array (B) in order to get len(A) number of arrays with same number of rows and columns as the first two arrays.
Any help?
pseudo-code
from numpy import *
import numpy as np
def multipar():
A = array( [ (0.1,0.5,0.2,0.2), (0.2,0.5,0.1,0.2), (0.7,0.1,0.1,0.1) ] )
B = array( [ (1,2,3,4), (2,3,4,5), (3,4,5,6) ] )
for i in len(A):
average = A[i]*B
print average
multipar()
I would like to have each resulting new array
Array C
(0.1,0.5,0.2,0.2) * (1,2,3,4);
(0.1,0.5,0.2,0.2) * (2,3,4,5);
(...)
Array D
(0.2,0.5,0.1,0.2) * (1,2,3,4);
(...)