[Numpy-discussion] 3D array problem in Python

Chris Barker - NOAA Federal chris.barker@noaa....
Sun Dec 30 18:35:35 CST 2012


On Sun, Dec 30, 2012 at 3:41 AM, Happyman <bahtiyor_zohidov@mail.ru> wrote:
> 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:

why the float() -- what data type is R?

>                                       else:
>                                                  val11[ i ] [ j ], val22[ i
> ][ j ] = integrate.quad( lambda x :  F1(x)*F2(x) , 0 , pi)

this is odd -- Do F1 and F2 depend on i,j, or k somehow? or are you
somehow integerting over the k-dimension? In which case, I'm guessing
that integration is you time killer anyway -- do some profiling to
know for sure.

-Chris

-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov


More information about the NumPy-Discussion mailing list