|
RE: Using sum() within a function: msg#00046python.numeric.general
> > Jim Cser wrote: >> >> The loop was indeed wrong, and "tempval = 0.*x" was the trick I needed, >> thanks. Unfortunately, iterating over t is still extremely slow. >> Ideally, there would be a way to use fromfunction() with slices as >> arguments. > If the other 3 dimensions are small (e.g., each time sample > involves an array whose size is less than 1000 elements total), > then the slowness is due to the small arrays. In that event > you may want iterate over a different dimension than time, or > construct the for loop to iterate over ranges of times rather > than one at a time. > > Perry I was just using T as a sample name, so I am not actually doing a time series of anything. My dimesions are on the order of numT = 500, numX = 500, numY = 100, numZ = 10, so smallness is not the problem. Unfortunately, I don't need to sum over Z, the short dimension. If my system didn't hang, I would have done it the easier way in the first place. Perhaps I need to learn more about memory management-- I'm sure that many Python users are crunching bigger even arrays than this. For what it's worth, I'm using Python 2.3 / Numarray 1.0 with PythonWin on an XP box, 512M RAM. -Jim ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | ANN: Python/Scientific Job openings at Enthought: 00046, eric jones |
|---|---|
| Next by Date: | Re: core dump during import: 00046, Skip Montanaro |
| Previous by Thread: | RE: Using sum() within a functioni: 00046, Perry Greenfield |
| Next by Thread: | Re: Using sum() within a function: 00046, Jim Cser |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |