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
___
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
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.
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
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:
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)
>