pair lists to create tuples in order

后端 未结 7 1877
不知归路
不知归路 2020-12-29 03:41

I\'d like to combine two lists. If I have the following two lists: {a,b,c,d} and {1,2,3,4} what do I need to do so that I get {{a,1}, {b,2},

7条回答
  •  暖寄归人
    2020-12-29 04:08

    If you have lists with the columns of a matrix:

    l = Table[Subscript[g, Sequence[j, i]], {i, 5}, {j, 5}]
    

    Transpose will give you the rows:

    Transpose@l // MatrixForm
    

提交回复
热议问题