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.
我想将两个二维数组组合成一个Nx2数组。比如a=[1,2,3] b=[4,5,6],我想做c=[(1,4),(2,5),(3,6)]。我想用python来做,但我不知道我应该使用什么命令。任何提示?
Nx2
a=[1,2,3] b=[4,5,6]
c=[(1,4),(2,5),(3,6)]
你可以用任何你想要的语言来做,算法可能是一样的。你想做的是
这是一些伪代码来说明
int [][] c; for (int i = 0; i < a.length; i++) { c[i][0] = a[i]; c[i][1] = b[i]; }