Wolfram mathematica 将2个单一dim列表交错到列表列表中
我有两个列表,Wolfram mathematica 将2个单一dim列表交错到列表列表中,wolfram-mathematica,Wolfram Mathematica,我有两个列表,{1,2,3,4,5}和{a,b,c,d,e}。我想以{{1,a},{2,b},{3,c},{4,d},{5,e}结束,这个怎么样: l1 = {1, 2, 3, 4, 5}; l2 = {a, b, c, d, e}; Partition[Riffle[l1, l2], 2] {1,a},{2,b},{3,c},{4,d},{5,e} 那很好。你试过什么? {{1, a}, {2, b}, {3, c}, {4, d}, {5, e}} l1 = {1, 2, 3, 4, 5
{1,2,3,4,5}
和{a,b,c,d,e}
。我想以{{1,a},{2,b},{3,c},{4,d},{5,e}
结束,这个怎么样:
l1 = {1, 2, 3, 4, 5};
l2 = {a, b, c, d, e};
Partition[Riffle[l1, l2], 2]
{1,a},{2,b},{3,c},{4,d},{5,e}
那很好。你试过什么? {{1, a}, {2, b}, {3, c}, {4, d}, {5, e}}
l1 = {1, 2, 3, 4, 5};
l2 = {a, b, c, d, e};
Transpose[{l1, l2}]
{{1, a}, {2, b}, {3, c}, {4, d}, {5, e}}