MathGroup Archive 2005

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

Search the Archive

Re: Simple List manipulation question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg58488] Re: [mg58476] Simple List manipulation question
  • From: Pratik Desai <pdesai1 at umbc.edu>
  • Date: Mon, 4 Jul 2005 02:24:09 -0400 (EDT)
  • References: <200507030757.DAA18308@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

DAN BIKLE wrote:

>Dear Mathematica Experts,
>
>Suppose I have a list like this:
>{{1, 2, 3, 4, 5}, {1, 4, 9, 16, 25}}
>
>Is there a quick way to transform it into this:
>
>{{1,1},{2,4},{3,9},{4,16},{5,25}}
>
>??
>
>-Dan
>--
>dbikle at gmail.com
>
>  
>
Hi
Try this

list1 = {{1, 2, 3, 4, 5}, {1, 4, 9, 16, 25}}
l = Length[Flatten[list1[[1]]]]
Table[{list1[[1]][[s]], list1[[2]][[s]]}, {s, 1, 5}]
 >>{{1, 1}, {2, 4}, {3, 9}, {4, 16}, {5, 25}}

best regards
Pratik

-- 
Pratik Desai
Graduate Student
UMBC
Department of Mechanical Engineering
Phone: 410 455 8134



  • Prev by Date: Re: Simple List manipulation question
  • Next by Date: Re: How build a function repeating the same pattern?
  • Previous by thread: Re: Simple List manipulation question
  • Next by thread: Re: Simple List manipulation question