import numpy as np
a = np.array([[1,2],
[3,4],
[5,6],
[7,8],
[9,10],
[11,12]])
print np.shape(a)
The expected answer should be:
answer = np.array([[1,2,7,8],
[3,4, 9, 10],
[5,6, 11, 12]])
I tried as
ans = a.reshape(3,-1)
print ans
[[ 1 2 3 4]
[ 5 6 7 8]
[ 9 10 11 12]]
But answer is wrong. How to do it?