Is there any easy way to flatten
import numpy np.arange(12).reshape(3,4) Out[]: array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11
For this I'd simply slice and concatenate:
n = a.shape[1]//2 np.concatenate([a[:,:n], a[:,n:]]).ravel() # array([ 0, 1, 4, 5, 8, 9, 2, 3, 6, 7, 10, 11])