Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: combining lists

  • To: mathgroup at smc.vnet.net
  • Subject: [mg32438] Re: [mg32435] combining lists
  • From: BobHanlon at aol.com
  • Date: Sun, 20 Jan 2002 04:28:16 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 1/19/02 8:07:49 PM, hvdosten at lb.netic.de writes:

>because I feel that I am again and again starting at the same point
>after a while, just a short question.
>
>How can I combine two lists, say:
>
>list1={{x1,y1},{x2,y2},...,{nx,ny}} and
>list2={{a1,b1},{a2,b2},...,{an,bn}}
>
>so that the combination would be:
>
>combined={{{x1,y1},{a1,b1}},{{x2,y2},{a2,b2}},....,{{xn,yn},{an,bn}}}
>
>I tried something like
>
>combi=Join[Take[#2]&,  list1,  Take[#,2]&,  list2]
>
>cimbined=Partition[combi,2]
>
>but without any success. I am sure it is easy but ....

Transpose[{list1, list2}]

or

Thread[{list1, list2}]


Bob Hanlon
Chantilly, VA  USA


  • Prev by Date: Re: parameter restrictions
  • Next by Date: Re: combining lists
  • Previous by thread: combining lists
  • Next by thread: Re: combining lists