Hi
I'd like to repeat an array along a new axis (like broadcast):
In [8]: a
Out[8]:
array([[0, 1, 2],
[3, 4, 5]])
In [9]: b=repeat(a[None,...], 3, axis=0)
In [10]: b
Out[10]:
array([[[0, 1, 2],
[3, 4, 5]],
[[0, 1, 2],
On Wed, Feb 15, 2012 at 2:25 AM, Steve Schmerler
elcort...@googlemail.comwrote:
Hi
I'd like to repeat an array along a new axis (like broadcast):
In [8]: a
Out[8]:
array([[0, 1, 2],
[3, 4, 5]])
In [9]: b=repeat(a[None,...], 3, axis=0)
In [10]: b
Out[10]:
On Feb 15 06:25 -0600, Warren Weckesser wrote:
Yes, such an array can be created using the as_strided() function from the
module numpy.lib.stride_tricks:
Thank you, I will look into that.
best,
Steve
___
NumPy-Discussion mailing list
Wow, I wasn't aware of that even if I work with numpy for years now.
NumPy is amazing.
Samuel
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Wed, Feb 15, 2012 at 15:16, Samuel John sc...@samueljohn.de wrote:
Wow, I wasn't aware of that even if I work with numpy for years now.
NumPy is amazing.
It's deliberately unpublicized because you can cause segfaults if you
get your math wrong. But once you get your math right and can wrap