[Numpy-discussion] How to concatenate two arrays without duplicating memory?

"V. Armando Solé" sole@esrf...
Wed Sep 2 02:40:49 CDT 2009


Hello,

Let's say we have two arrays A and B of shapes (10000, 2000) and (10000, 
4000).

If I do C=numpy.concatenate((A, B), axis=1), I get a new array of 
dimension (10000, 6000) with duplication of memory.

I am looking for a way to have a non contiguous array C in which the 
"left" (10000, 2000) elements point to A and the "right" (10000, 4000) 
elements point to B. 

Any hint will be appreciated.

Thanks,

Armando




More information about the NumPy-Discussion mailing list