[Numpy-discussion] Numpy Positional Array

2009-03-31 Thread Ian Mallett
Hello, I'm trying to make an array of size n*n*2. It should be of the form: [[[0,0],[1,0],[2,0],[3,0],[4,0], ... ,[n,0]], [[0,1],[1,1],[2,1],[3,1],[4,1], ... ,[n,1]], [[0,2],[1,2],[2,2],[3,2],[4,2], ... ,[n,2]], [[0,3],[1,3],[2,3],[3,3],[4,3], ... ,[n,3]], [[0,4],[1,4],[2,4],[3,4],[4,4], ...

Re: [Numpy-discussion] Numpy Positional Array

2009-03-31 Thread Robert Kern
2009/3/31 Ian Mallett geometr...@gmail.com: Hello, I'm trying to make an array of size n*n*2.  It should be of the form: [[[0,0],[1,0],[2,0],[3,0],[4,0], ... ,[n,0]],  [[0,1],[1,1],[2,1],[3,1],[4,1], ... ,[n,1]],  [[0,2],[1,2],[2,2],[3,2],[4,2], ... ,[n,2]],  [[0,3],[1,3],[2,3],[3,3],[4,3],

Re: [Numpy-discussion] Numpy Positional Array

2009-03-31 Thread Ian Mallett
On Tue, Mar 31, 2009 at 5:32 PM, Robert Kern robert.k...@gmail.com wrote: How do you want to fill in the array? If you are typing it in literally into your code, you would do basically the above, without the ...'s, and wrap it in numpy.array(...). I know that, but in some cases, n will be

Re: [Numpy-discussion] Numpy Positional Array

2009-03-31 Thread Robert Kern
2009/3/31 Ian Mallett geometr...@gmail.com: On Tue, Mar 31, 2009 at 5:32 PM, Robert Kern robert.k...@gmail.com wrote: How do you want to fill in the array? If you are typing it in literally into your code, you would do basically the above, without the ...'s, and wrap it in numpy.array(...).

Re: [Numpy-discussion] Numpy Positional Array

2009-03-31 Thread Robert Kern
2009/3/31 Ian Mallett geometr...@gmail.com: The array follows a pattern: each array of length 2 represents the x,y index of that array within the larger array. Ah, right. Use dstack(mgrid[0:n,0:n]). -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma

Re: [Numpy-discussion] Numpy Positional Array

2009-03-31 Thread Ian Mallett
Thanks! ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Numpy Positional Array

2009-03-31 Thread Partridge, Matthew BGI SYD
The array follows a pattern: each array of length 2 represents the x,y index of that array within the larger array. Is this what you are after? numpy.array(list(numpy.ndindex(n,n))).reshape(n,n,2) -- This message and any attachments are confidential, proprietary, and may be

Re: [Numpy-discussion] Numpy Positional Array

2009-03-31 Thread Ian Mallett
Same. Thanks, too. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion