def repeat(arr, num):
arr = numpy.asarray(arr)
return numpy.ndarray(arr.shape+(num,), dtype=arr.dtype,
buffer=arr, strides=arr.strides+(0,))
There are limits to what these sort of stride tricks can accomplish,
but repeating as above, or similar, is feasible.
On Jan 1, 2011, at 8:42
On Sat, Jan 1, 2011 at 19:42, Enzo Michelangeli enzom...@gmail.com wrote:
Is there any way, not involving compilation of C code, to define ndarrays
where some rows or columns share the same data buffers? For example,
something built by a hypothetical variant of the np.repeat() function, such
- Original Message -
From: Robert Kern robert.k...@gmail.com
To: Discussion of Numerical Python numpy-discussion@scipy.org
Sent: Sunday, January 02, 2011 10:08 AM
Subject: Re: [Numpy-discussion] Arrays with aliased elements?
On Sat, Jan 1, 2011 at 19:42, Enzo Michelangeli enzom...@gmail.com