[Numpy-discussion] Can I add rows and columns to recarray?

Christopher Barker Chris.Barker@noaa....
Mon Dec 6 16:44:54 CST 2010


On 12/6/10 1:00 PM, Wai Yip Tung wrote:
> Thank you for the quick response and Christopher's explanation on the
> design background.

you're welcome.

> But if adding row build a new array, this will lead to O(n^2) complexity.

if you are adding a lot of rows one at a time, yes, you can have 
performance issues -- though re-allocating data is pretty fast, too -- 
maybe it won't matter.

If it does, consider the accumulator code I sent, or use it as 
inspiration to write your own.

If you do improve it, please send your improvements back to me.

-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