I want to get an array containing the element wise multiplication of n>2 arrays. Specifically, is there a way to vectorize the below example code (here n=3 but I will in general need to do this for n>=3) in numpy?
p1=np.array([0.5,0.2,0.3])
p2=np.array([0.3,0.1,0.6])
p3=np.array([0.8,0.1,0.1])
p=np.zeros((p1.shape[0],p2.shape[0],p3.shape[0] ))
for i in range(p1.shape[0]):
for j in range(p2.shape[0]):
for k in range(p3.shape[0]):
p[i,j,k] = p1[i]*p2[j]*p3[k]