[Numpy-discussion] Create 2D array from EXISTING 1D array

Ruben Salvador rsalvador.wk@gmail....
Mon Sep 14 07:31:14 CDT 2009


Perfect, that's exactly what I need! Somehow I missed this routine when
checking documentation :S

In [58]: a
Out[58]: array([1, 2, 3])

In [59]: np.tile(a, (5,1))
Out[59]:
array([[1, 2, 3],
[1, 2, 3],
[1, 2, 3],
[1, 2, 3],
[1, 2, 3]])

Thanks a lot!

On Mon, Sep 14, 2009 at 1:07 PM, Citi, Luca <lciti@essex.ac.uk> wrote:

> if I get your question correctly, np.tile could be what you need
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090914/0bf3aa6c/attachment.html 


More information about the NumPy-Discussion mailing list