Re: [Numpy-discussion] How to concatenate two arrayswithout duplicating memory?

2009-09-02 Thread Citi, Luca
As Gaël pointed out you cannot create A, B and then C as the concatenation of A and B without duplicating the vectors. I am looking for a way to have a non contiguous array C in which the left (1, 2000) elements point to A and the right (1, 4000) elements point to B. But you can

Re: [Numpy-discussion] How to concatenate two arrayswithout duplicating memory?

2009-09-02 Thread V. Armando Solé
Citi, Luca wrote: As Gaël pointed out you cannot create A, B and then C as the concatenation of A and B without duplicating the vectors. But you can still re-link A to the left elements and B to the right ones afterwards by using views into C. Thanks for the hint. In my case the A

Re: [Numpy-discussion] How to concatenate two arrayswithout duplicating memory?

2009-09-02 Thread Sebastian Haase
Hi, depending on the needs you have you might be interested in my minimal implementation of what I call a mock-ndarray. I needed somthing like this to analyze higher dimensional stacks of 2d images and what I needed was mostly the indexing features of nd-arrays. A mockarray is initialized with a

Re: [Numpy-discussion] How to concatenate two arrayswithout duplicating memory?

2009-09-02 Thread Sturla Molden
Sebastian Haase skrev: A mockarray is initialized with a list of nd-arrays. The result is a mock array having one additional dimention in front. This is important, because often in the case of 'concatenation' a real concatenation is not needed. But then there is a common tool called Matlab,

Re: [Numpy-discussion] How to concatenate two arrayswithout duplicating memory?

2009-09-02 Thread Sebastian Haase
I forgot to mention I also support transpose. -S. On Wed, Sep 2, 2009 at 5:23 PM, Sturla Moldenstu...@molden.no wrote: Sebastian Haase skrev: A mockarray is initialized with a list of nd-arrays. The result is a mock array having one additional dimention in front. This is important, because