Re: How to create this kind of list

• To: mathgroup at smc.vnet.net
• Subject: [mg122133] Re: How to create this kind of list
• From: Tomas Garza <tgarza10 at msn.com>
• Date: Sun, 16 Oct 2011 07:05:42 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• References: <201110151004.GAA03200@smc.vnet.net>

```I'm sure you'll get many other suggestions from the gurus in this group, but these five seem pretty obvious:
In[1]:= listA = {a1, a2, a3, a4, a5, a6}; listB = {b1, b2, b3, b4, b5, b6};
In[2]:= Transpose@{listA, listB}
Out[2]= {{a1, b1}, {a2, b2}, {a3, b3}, {a4, b4}, {a5, b5}, {a6, b6}}
Out[3]= {{a1, b1}, {a2, b2}, {a3, b3}, {a4, b4}, {a5, b5}, {a6, b6}}
In[4]:= Partition[Riffle[listA, listB], 2]
Out[4]= {{a1, b1}, {a2, b2}, {a3, b3}, {a4, b4}, {a5, b5}, {a6, b6}}
In[5]:= Table[{listA[[j]], listB[[j]]}, {j, 1, Length[listA]}]
Out[5]= {{a1, b1}, {a2, b2}, {a3, b3}, {a4, b4}, {a5, b5}, {a6, b6}}
--Tomas

> Date: Sat, 15 Oct 2011 06:04:15 -0400
> From: szymon.roziewski at gmail.com
> Subject: How to create this kind of list
> To: mathgroup at smc.vnet.net
>
> Hello there,
> I am thinking about creating such a list.
> I have 2 lists with the same number of elements.
> The idea is to create one list which was taken from these previous two ones
> in the following way:
> Take one element of the first list and one from another and put it into
> result list {{x1,y1},{x2,y2},...,{xn,yn}}.
> Input lists:
> A={x1,x2,...,xn}
> B={y1,y2,...,yn}
>
> All best,
> Szymon Roziewski

```

• Prev by Date: Re: Only real data
• Next by Date: Re: Only real data
• Previous by thread: Re: How to create this kind of list
• Next by thread: Re: How to create this kind of list