【发布时间】:2020-07-11 08:58:33
【问题描述】:
我有一个数组:[1, 2, 3, 4, 5, 6]。我想使用numpy.reshape() 函数,这样我就得到了这个数组:
[[1, 4],
[2, 5],
[3, 6]
]
我不知道该怎么做。我一直以这个结束,这不是我想要的:
[[1, 2],
[3, 4],
[5, 6]
]
【问题讨论】:
-
np.array(data).reshape(2,-1).T?
标签: python arrays numpy reshape