请考虑以下场景:
a = np.array([[1,1,1,3,3,3], [2,2,2,4,4,4]])
np.reshape(a, (4, 3))
输出:
array([[1, 1, 1],
[3, 3, 3],
[2, 2, 2],
[4, 4, 4]])
请注意,情况并非如此.
array([[1, 1, 1],
[2, 2, 2],
[3, 3, 3],
[4, 4, 4]])
How can I reshape the array so the rows stay paired together and the overflowing columns wrap below the existing rows?