Mathematica - turning two lists into an array

  • Thread starter tomrob123
  • Start date
Hi

I need to turn two lists in the form {a1,a2,a3...} {b1,b2,b3...}
into {{a1,b1},{a2,b2},{a3,b3}..}

I've looked everywhere on the Wolfram website and the best i found was:

Riffle[{list1},{list2}] which gives me {a1,b1,a2,b2,a3,b3}

does anyone know the function to use?

Thanks
 
Hi,
Maybe this:
Transpose[{{a1, a2, a3}, {b1, b2, b3}}]
 

Mapes

Science Advisor
Homework Helper
Gold Member
2,592
17
Equivalently, {{a1, a2, a3}, {b1, b2, b3}}TR. (The transpose symbol comes from hitting Esc, tr, Esc.)
 

Want to reply to this thread?

"Mathematica - turning two lists into an array" You must log in or register to reply here.

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top