You are close, you want to use np.tile
, but like this:
a = np.array([0,1,2])
np.tile(a,(3,1))
Result:
array([[0, 1, 2],
[0, 1, 2],
[0, 1, 2]])
If you call np.tile(a,3)
you will get concatenate
behavior like you were seeing
array([0, 1, 2, 0, 1, 2, 0, 1, 2])
http://docs.scipy.org/doc/numpy/reference/generated/numpy.tile.html