Re: numarray.array can be VERY slow
- From: Steven Bethard <steven.bethard@xxxxxxxxx>
- Date: Sun, 10 Apr 2005 14:31:04 -0600
Edward C. Jones wrote:
Steven Bethard wrote:
> As mentioned, this has nothing to do with numarray, and everything to > do with your inexplicable use of lists. Why don't you just write this > as: > > arr = numarray.ones((8, 8, 256, 256), Float64)
The code I posted was simplified from a larger program which I have now revised. But I still ask: why did it take 4.3 seconds to run?
And I repeat, because you were using lists, not numarray. ;) If you want a numarray array, create it directly, don't create it from lists.
What's your real code look like? Are you sure you need two nested loops? If you're sure, can you do something like
import numarray as na
arr = na.zeros((8, 8, 256, 256))
for i in xrange(8):
for j in xrange(8):
arr[i,j] = na.ones((256, 256))
where you allocate the array first and then fill it?
STeVe .
- References:
- Re: numarray.array can be VERY slow
- From: Edward C. Jones
- Re: numarray.array can be VERY slow
- Prev by Date: Re: numarray.array can be VERY slow
- Next by Date: Re: numarray.array can be VERY slow
- Previous by thread: Re: numarray.array can be VERY slow
- Next by thread: Re: numarray.array can be VERY slow
- Index(es):
Relevant Pages
|