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

Travis E. Oliphant oliphant@enthought....
Mon Mar 17 12:52:11 CDT 2008


Chris Withers wrote:
> Hi All,
>
> I'm using xlrd to read an excel workbook containing several columns of 
> data as follows:
>   
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.

If you need to resize, then use the resize *function* which basically 
handles the creating of the new array.  However, it also replicates the 
data, which may not be what you want.

-Travis O.




More information about the Numpy-discussion mailing list