[Numpy-discussion] Using as_strided to avoid copy on repeat (with 2-dimensional array)

Robert Kern robert.kern@gmail....
Mon Aug 12 16:23:29 CDT 2013

On Mon, Aug 12, 2013 at 10:01 PM, Nicolas Rougier <Nicolas.Rougier@inria.fr>
> Hi,
> I have a (n,2) shaped array representing points and I would like to
double each point as in:
> A = np.arange(10*2).reshape(10,2)
> B = np.repeat( A, 2, axis=0 )
> Is it possible to do the same using 'as_strided' to avoid copy (and still
get the same output shape for B) ?

No, this would not be uniformly strided in the 0 axis.

Robert Kern
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20130812/42009266/attachment.html 

More information about the NumPy-Discussion mailing list