I wanted to interleave the rows of two numpy arrays of the same size. I came up with this solution.
# A and B are same-shaped arrays A = numpy.ones((4,3)) B
It is maybe a bit clearer to do:
A = np.ones((4,3)) B = np.zeros_like(A) C = np.empty((A.shape[0]+B.shape[0],A.shape[1])) C[::2,:] = A C[1::2,:] = B
and it's probably a bit faster as well, I'm guessing.