[Numpy-discussion] is there a better way to do this arrayrepeat?

Chris Colbert sccolbert@gmail....
Mon Aug 17 11:20:14 CDT 2009


That's exactly it. Thanks!

On Mon, Aug 17, 2009 at 5:24 AM, Citi, Luca<lciti@essex.ac.uk> wrote:
> As you stress on "repeat the array ... rather than repeat each element",
> you may want to consider tile as well:
>
>>>> np.tile(a, [10,1])
> array([[0, 1, 2],
>       [0, 1, 2],
>       [0, 1, 2],
>       [0, 1, 2],
>       [0, 1, 2],
>       [0, 1, 2],
>       [0, 1, 2],
>       [0, 1, 2],
>       [0, 1, 2],
>       [0, 1, 2]])
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>


More information about the NumPy-Discussion mailing list