Re: extracting a list to a list, help please
- To: mathgroup at smc.vnet.net
- Subject: [mg46173] Re: extracting a list to a list, help please
- From: bobhanlon at aol.com (Bob Hanlon)
- Date: Tue, 10 Feb 2004 00:05:40 -0500 (EST)
- References: <c07p1q$kk7$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
mylist1 = {{a1,b1,c1,d1},{a2,b2,c2,d2},{a3,b3,c3,d3}}; mylist2 = mylist1[[All, {1,2}]] {{a1, b1}, {a2, b2}, {a3, b3}} mylist2 == (Take[#, 2]& /@ mylist1) True mylist2 == (Drop[#, -2]& /@ mylist1) True Bob Hanlon In article <c07p1q$kk7$1 at smc.vnet.net>, Serge <nospam at nospam.com> wrote: << 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.