Re: Noah's List
- To: mathgroup at smc.vnet.net
- Subject: [mg5695] Re: [mg5673] Noah's List
- From: Sherman Reed <Sherman.Reed at worldnet.att.net>
- Date: Sat, 11 Jan 1997 14:29:00 -0500
- Sender: owner-wri-mathgroup at wolfram.com
At 04:22 PM 1/7/97 +0000, you wrote:
>I have two lists, x and y, each containing n elements. I would like to
>generate a new list, {{x[[1]],y[[1]]}, {x[[2]],y[[2]]},...
>{x[[n]],y[[n]]}}, but have been unable to figure out a shorthand for it.
>Any help would be much appreciated.
>
>--
>HaHa
>Rarebit Dreams
>
>
>
here is a simple but elegant way due to N. Blachman
list1={x1,x2,x3,x4,x5}
list2={y1,y2,y3,y4,y5}
Transpose[{list1,list2}]
of course, one could use a for loop and brute force.
Sherman C. Reed
>