Re: [Numpy-discussion] Interleaved Arrays and

2009-06-18 Thread Ian Mallett
Most excellent solutions, thanks! ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Interleaved Arrays and

2009-06-16 Thread Robert
Ian Mallett wrote: n = #blah testlist = [] for x in xrange(n): for y in xrange(n): testlist.append([x,y]) testlist.append([x+1,y]) If testlist is an array (i.e., I could go: array(testlist)), it works nicely. However, my Python method is certainly improveable

Re: [Numpy-discussion] Interleaved Arrays and

2009-06-16 Thread Neil Martinsen-Burrell
On 06/16/2009 02:18 PM, Robert wrote: n = 10 xx = np.ones(n) yy = np.arange(n) aa = np.column_stack((xx,yy)) bb = np.column_stack((xx+1,yy)) aa array([[ 1., 0.], [ 1., 1.], [ 1., 2.], [ 1., 3.], [ 1., 4.], [ 1.,

Re: [Numpy-discussion] Interleaved Arrays and

2009-06-16 Thread Robert
Neil Martinsen-Burrell wrote: On 06/16/2009 02:18 PM, Robert wrote: n = 10 xx = np.ones(n) yy = np.arange(n) aa = np.column_stack((xx,yy)) bb = np.column_stack((xx+1,yy)) aa array([[ 1., 0.], [ 1., 1.], [ 1., 2.], [ 1., 3.],

Re: [Numpy-discussion] Interleaved Arrays and

2009-06-16 Thread Neil Martinsen-Burrell
On 2009-06-16 16:05 , Robert wrote: Neil Martinsen-Burrell wrote: On 06/16/2009 02:18 PM, Robert wrote: n = 10 xx = np.ones(n) yy = np.arange(n) aa = np.column_stack((xx,yy)) bb = np.column_stack((xx+1,yy)) aa array([[ 1., 0.], [ 1., 1.],

Re: [Numpy-discussion] Interleaved Arrays and

2009-06-16 Thread Anne Archibald
I'm not sure it's worth having a function to replace a one-liner (column_stack followed by reshape). But if you're going to implement this with slice assignment, you should take advantage of the flexibility this method allows and offer the possibility of interleaving raggedly, that is, where the

[Numpy-discussion] Interleaved Arrays and

2009-06-15 Thread Ian Mallett
Hi, So I'm trying to get a certain sort of 3D terrain working in PyOpenGL. The idea is to get vertex buffer objects to draw a simple 2D plane comprised of many flat polygons, and use a vertex shader to deform that with a heightmap and map that on a sphere. I've managed to do this with a grid