Re: [Numpy-discussion] Single view on multiple arrays

2009-11-01 Thread Sturla Molden
Bill Blinn skrev: > v = multiview((3, 4)) > #the idea of the following lines is that the 0th row of v is > #a view on the first row of a. the same would hold true for > #the 1st and 2nd row of v and the 0th rows of b and c, respectively > v[0] = a[0] This would not even work, becuase a[0] does not

Re: [Numpy-discussion] Single view on multiple arrays

2009-11-01 Thread Sturla Molden
Anne Archibald skrev: > The short answer is, you can't. Not really true. It is possible create an array (sub)class that stores memory addresses (pointers) instead of values. It is doable, but I am not wasting my time implementing it. Sturla ___ NumP

Re: [Numpy-discussion] Single view on multiple arrays

2009-11-01 Thread Anne Archibald
2009/11/1 Bill Blinn : > What is the best way to create a view that is composed of sections of many > different arrays? The short answer is, you can't. Numpy arrays must be located contiguous blocks of memory, and the elements along any dimension must be equally spaced. A view is simply another ar

[Numpy-discussion] Single view on multiple arrays

2009-11-01 Thread Bill Blinn
What is the best way to create a view that is composed of sections of many different arrays? For example, imagine I had a = np.array(range(0, 12)).reshape(3, 4) b = np.array(range(12, 24)).reshape(3, 4) c = np.array(range(24, 36)).reshape(3, 4) v = multiview((3, 4)) #the idea of the following lin