have two arrays that are like this
x = [a,b]
y = [p,q,r]
I need to multiply this together to a product c which should be like this,
c = [a*p, a*q, a*r, b*p, b*q, b*r]
However x*y gives the following error,
ValueError: operands could not be broadcast together with shapes (2,) (3,)
I can do something like this,
for i in range(len(x)):
for t in range(len(y)):
c.append(x[i] * y[t]
But really the length of my x and y is quite large so what's the most efficient way to make such a multiplication without the looping.
a,b,p,qetc are scalars or something else? - Divakara*r- kasravnd