Re: [Numpy-discussion] memory address of array data?

2009-08-16 Thread Stéfan van der Walt
2009/8/16 Robert : > Is there a function to get the memory address (int) of > (contigious) ndarray data on Python level - like > array.array.buffer_info() ? > I'd need it to pass it to a camera function. Have a look at the array interface: x.__array_interface__['data'] Regards Stéfan ___

[Numpy-discussion] memory address of array data?

2009-08-16 Thread Robert
Is there a function to get the memory address (int) of (contigious) ndarray data on Python level - like array.array.buffer_info() ? I'd need it to pass it to a camera function. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.sc

Re: [Numpy-discussion] is there a better way to do this array repeat?

2009-08-16 Thread Chris Colbert
great, thanks! by order I meant repeat the array in order rather than repeat each element. On 8/16/09, Stéfan van der Walt wrote: > 2009/8/16 Chris Colbert : >> I have a 1x3 array that I want to repeat n times and form an nx3 array >> where each row is a copy of the original array. > > a = np.

Re: [Numpy-discussion] is there a better way to do this array repeat?

2009-08-16 Thread Stéfan van der Walt
2009/8/16 Chris Colbert : > I have a 1x3 array that I want to repeat n times and form an nx3 array > where each row is a copy of the original array. a = np.arange(3)[None, :] np.repeat(a, 10, axis=0) Regards Stéfan ___ NumPy-Discussion mailing list NumP

Re: [Numpy-discussion] is there a better way to do this array repeat?

2009-08-16 Thread Robert Kern
On Sun, Aug 16, 2009 at 19:01, Chris Colbert wrote: > I don't think np.repeat will do what I want because the order needs to > be preserved. "Order"? > I have a 1x3 array that I want to repeat n times and form an nx3 array > where each row is a copy of the original array. > > So far I have this:

[Numpy-discussion] is there a better way to do this array repeat?

2009-08-16 Thread Chris Colbert
I don't think np.repeat will do what I want because the order needs to be preserved. I have a 1x3 array that I want to repeat n times and form an nx3 array where each row is a copy of the original array. So far I have this: >>> import numpy as np >>> a = np.arange(3) >>> b = np.asarray([a]*10) >