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

Citi, Luca lciti at essex.ac.uk
Mon Aug 17 05:24:48 EDT 2009


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]])




More information about the NumPy-Discussion mailing list