MathGroup Archive 2004

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

Search the Archive

Re: extracting a list to a list, help please


Hi Serge,

You have to use

mylist2 = Map[ Take[#1, 2]&, mylist1 ];

Take[ someList, 2]  returns first two elements of that list.
Notice, that mylist1 is a list, elements of which are lists
themselves. So Map will apply Take function to each element of mylist1.

Regards,
Sasha

Serge wrote:

> Hello,
> 
> I am a beginner in Mathematica and I have a rather simple question. I 
> made some calculations that I need for an orbit and I have a list that 
> look like this:
> 
> mylist1 = {{a1,b1,c1,d1},{a2,b2,c2,d2},{a3,b3,c3,d3},etc}
> 
> All I want to do is to make a list of the form
> 
> mylist2 = {{a1,b1},{a2,b2},{a3,b3},etc}
> 
> from the original list (mylist1),
> 
> so that I can ListPlot those pairs of points (they represent x and y 
> coordinates for some orbit). I am having trouble figuring out how to do 
> this. I tried using the Table command but I couldn't get it into the 
> above form. I would greatly appreciate if someone can help me out. 
> Thanks so much.
> 
> Best,
> Serge
> 

-- 
Office: 6H Osmond                    Web: http://www.pavlyk.com
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     No trees were destroyed to send this mail,
           but a lot of electrons were terribly disturbed.


  • Prev by Date: Re: Algebraic Manipulation
  • Next by Date: RE: extracting a list to a list, help please
  • Previous by thread: Re: extracting a list to a list, help please
  • Next by thread: Re: extracting a list to a list, help please