MathGroup Archive 2011

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

Search the Archive

Re: How to create this kind of list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg122135] Re: How to create this kind of list
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Sun, 16 Oct 2011 07:06:04 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

On 10/15/11 at 6:04 AM, szymon.roziewski at gmail.com (Szymon Roziewski)
wrote:

>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}

With same length lists, what you want is easily done in a number
of ways. Probably the most straight forward would be

Transpose@{a,b}

other ways include

MapThread[List, {a,b}]
Partition[Riffle[a,b],2]






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