I have an numpy array with size of 10x250000 and I need to change values of it during the program but using "for loop" make my program very slow. it is the mentioned section of program. (L2 , L1 and T are other arrays) :
EEf1=numpy.zeros((10,250000))
for m in range(10):
for n in range(250000):
EEf1[m,n]+=2*(L2[m,0]-T[m,0])*L2[m,0]*(1-L2[m,0])*L1[n,0]
My question : Is there any solution to use numpy features to avoid this loop ? I have tried fromfunction method like this (for example):
np.fromfunction(lambda i,j : A[i,j]+B[i,j] , (2,2))
(A and B are 2x2 arrays) but it doesnt work. I really need to avoid this loop. can anyone help ?