Re: list manipulation problem

*To*: mathgroup at smc.vnet.net*Subject*: [mg9098] Re: list manipulation problem*From*: steve at smc.vnet.net*Date*: Mon, 13 Oct 1997 23:33:13 -0400*Sender*: owner-wri-mathgroup at wolfram.com

In[1]:= {{a, b, c}, {d, e, f}, {g, h, i}} Out[1]= {{a, b, c}, {d, e, f}, {g, h, i}} In[2]:= Map[Take[#,2]&,%] Out[2]= {{a, b}, {d, e}, {g, h}} is another way. Steve Christnesen Moderator > From jason at pernet.com Thu Oct 9 20:29:16 1997 > To: comp-soft-sys-math-mathematica at moderators.uu.net > From: jason at pernet.com (Jason Welter) To: mathgroup at smc.vnet.net > Subject: [mg9098] Re: list manipulation problem > Date: Fri, 10 Oct 1997 00:22:23 GMT > Message-ID: <343d74b9.20598713 at news.mindspring.com> > Content-Length: 367 > > On 9 Oct 1997 01:42:53 -0400, Teemu Vesanen <Teemu.Vesanen at sci.fi> > wrote: > > >I have a list like > >{{a, b, c}, {d, e, f}, {g, h, i}} > >I need to delete the third term of each sublist. > >In other words how do I make the list look like > >{{a, b}, {d, e}, {g, h}} > > lista = {{a, b, c}, {d, e, f}, {g, h, i}}; > answer = Transpose[{Transpose[lista][[1]],Transpose[lista][[2]]}]; > >