Q:

How can I repeat this array of 2d pairs using Numpy?

I have an array that I want to repeat.
test = numpy.array([(1, 11,), (2, 22), (3, 33)])
Now
numpy.repeat(test, 2, 0)
numpy.repeat(test, 2, 1)

results in
array([[ 1, 11],
       [ 1, 11],
       [ 2, 22],
       [ 2, 22],
       [ 3, 33],
       [ 3, 33]])
array([[ 1,  1, 11, 11],
       [ 2,  2, 22, 22],
       [ 3,  3, 33, 33]]).

While
numpy.tile(test, 2)

results in
array([[ 1, 11,  1, 11],
       [ 2, 22,  2, 22],
       [ 3, 33,  3, 33]]).

How can I get this result instead?
array([[ 1, 11],
       [ 2, 22],
       [ 3, 33],
       [ 1, 11],
       [ 2, 22],
       [ 3, 33]])

Alternatively, for my use case I only use the repeated values once. To avoid the memory allocations, is there a way to have a generator of the repeated series instead somehow?

A:

np.tile lets you specify repeats for each axis (as a tuple)
In [370]: np.tile(test,(2,1))
Out[370]: 
array([[ 1, 11],
       [ 2, 22],
       [ 3, 33],
       [ 1, 11],
       [ 2, 22],
       [ 3, 33]])

