MathGroup Archive 1997

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

Search the Archive

Re: list manipulation problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg9082] Re: [mg9062] list manipulation problem
  • From: mabi at solidmr.kun.nl (Marlies Brinksma)
  • Date: Mon, 13 Oct 1997 23:33:01 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Teemu,

You could do the following:

In[1]:=
yourlist={{a,b,c},{d,e,f},{g, h, i}}

Out[1]=
{{a,b,c},{d,e,f},{g,h,i}}

In[2]:=
Map[Drop[#,-1]&,yourlist]

Out[2]=
{{a,b},{d,e},{g,h}}


Regards,

Marlies




> I have a list like=20
> {{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}}
> ///////////////////////////////////=20
> //Teemu Vesanen///////////////////
> //E-Mail: Teemu.Vesanen at sci.fi///
> //Tel +358(42)714186////////////
> //P-Mail: Maurialantie 1///////
> //////////42100 J=E4ms=E4/////////
> //////////Finland////////////
> ////////////////////////////
> 
> "Perhaps the kind of humanity that can produce Hamlet, Don Giovanni, the
> Choral Symphony, the Theory of Relativity, Gaudi, Schoenberg and Picasso
> must, as a necessary corollary, also be able to scare hell out of itself
> with nuclear weapons", Anthony Burgess.



  • Prev by Date: Re: Re: weird Log[0] *0 result
  • Next by Date: Re: list manipulation problem
  • Previous by thread: Re: list manipulation problem
  • Next by thread: Re: list manipulation problem