I'm wondering that must be a way of doing the following without the for loop:
import numpy
from itertools import product as itprod
a = np.arange(120.).reshape(3,2,5,2,2)
fact = np.linspace(1,1.4,15).reshape((3,5))
for i,j in itprod(range(3),range(5)):
a[i,:,j]*= fact[i,j]
Any suggestions??