[Numpy-discussion] 3D array problem in Python
Happyman
bahtiyor_zohidov at mail.ru
Sun Dec 30 06:41:26 EST 2012
Hello
I have 3 dimensional array which I want to calculate in a huge process. Everything is working well if I use ordinary way which is unsuitable in Python like the following:
nums=32
rows=120
cols=150
for k in range(0,nums):
for i in range(0,rows):
for j in range(0,cols):
if float ( R[ k ] [ i ] [ j ] ) == 0.0:
val11 [ i ] =0.0
else:
val11[ i ] [ j ], val22[ i ][ j ] = integrate.quad( lambda x : F1(x)*F2(x) , 0 , pi)
But, this calculation takes so long time, let's say about 1 hour (theoretically)... Is there any better way to easily and fast calculate the process such as [ F( i ) for i in xlist ] or something like that rather than using for loop?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20121230/5020f6af/attachment.html>
More information about the NumPy-Discussion
mailing list