Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个形式的数组:
a = np.array([1,2,3]) b = np.array([4,5,6])
是否有一个 NumPy 函数可以应用于这些数组以获得后续输出?
[[1,4],[2,5][3,6]]
np.vstack((a,b)).T
返回
array([[1, 4], [2, 5], [3, 6]])
和
np.vstack((a,b)).T.tolist()
准确返回您需要的内容:
[[1, 4], [2, 5], [3, 6]]