[Numpy-discussion] how to build a series of arrays as I go?

Chris Withers chris@simplistix.co...
Tue Mar 18 04:27:11 CDT 2008


Travis E. Oliphant wrote:
> Generally, arrays are not efficiently re-sized.  It is best to 
> pre-allocate, or simply create a list by appending and then convert to 
> an array after the fact as you have done.

True, although that feels like iterating over the data twice for no 
reason, which feels a bit weird.

In my case, I want to create a masked array, it would be nice to be able 
to do that straight from a list, rather than having to turn the list 
into an array and then turning the array into a masked array.

If I'm off base on this, let me know :-)

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Numpy-discussion mailing list