C = np.empty((len(A), 2, 3, 4), np.int)
C[..., (0)] = A[:, (0)][:, (None), (None)]
C[..., (1)] = A[:, 1:3][:, :, (None)]
C[..., (2)] = A[:, 3:][:, (None), :]
C[..., (3)] = np.arange(len(A) * 2).reshape(len(A), 2, 1) + 1
C = C.reshape(-1, 4)
C = C[C[:, (2)] != 0]
print(C)
Create a new numpy array based on conditions set out in numpy array