Same. Thanks, too.
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
> 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
Thanks!
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
2009/3/31 Ian Mallett :
> 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 that is made terribl
The array follows a pattern: each array of length 2 represents the x,y index
of that array within the larger array.
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
2009/3/31 Ian Mallett :
> On Tue, Mar 31, 2009 at 5:32 PM, Robert Kern 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
On Tue, Mar 31, 2009 at 5:32 PM, Robert Kern 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 quite large, perhaps 1
2009/3/31 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]],
>
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], ... ,