1

If I have two lists such as:

list1={60,65,70,75,80,85,87}

list2= {4.14166, 4.15138, 3.22417, 2.9524, -0.188672, 0.0653777, -0.63967}

How can I combine the two list to get a list like

list3={{value1list1,value1list2},{value2list1,value2list2},{value3list1,value3list2}....etc}

or with numbers

list3={{60,4.14166},{70, 4.15138},{75,3.22417}....etc}

John
  • 1,611
  • 4
  • 14

1 Answers1

2

Here are a couple of more ways, in addition to the methods mentioned in the comments:

1. Using MapThread

   In[115]:= MapThread[{#1, #2} &, {list1, list2}]

Out[115]= {{60, 4.14166}, {65, 4.15138}, {70, 3.22417}, {75, 2.9524}, {80, -0.188672}, {85, 0.0653777}, {87, -0.63967}}

2. Using Map and Lenght of the list

   In[116]:= {list1[[#]], list2[[#]]} & /@ Range[Length[list1]]

Out[116]= {{60, 4.14166}, {65, 4.15138}, {70, 3.22417}, {75, 2.9524}, {80, -0.188672}, {85, 0.0653777}, {87, -0.63967}}

Sâu
  • 535
  • 2
  • 10