Re: Parts of a list
- To: mathgroup at smc.vnet.net
- Subject: [mg15438] Re: [mg15430] Parts of a list
- From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
- Date: Mon, 18 Jan 1999 04:21:42 -0500
- Sender: owner-wri-mathgroup at wolfram.com
The best way is to use DeleteCases : In[23]:= x={{1,0},{2.5, .5},{3,0},{0,2}} Out[23]= {{1,0},{2.5,0.5},{3,0},{0,2}} In[24]:= DeleteCases[x,{x_,0}] Out[24]= {{2.5,0.5},{0,2}} On Wed, Jan 13, 1999, Hossein Kazemi <kazemi at som.umass.edu> wrote: >I have a list (matrix) that looks like this > >x={{1,0},{2.5, .5},{3,0},{0,2}} > >Now I want to eliminate those vectors that have zero for the second >case. That is, I want to get > >{{2.5, .5},{0,2}}. > >Is there a quick way of doing this? >I tried to apply Select to this but could not get it to work. > >Thanks for your help. > >Hossein Kazemi >UMass >kazemi at som.umass.edu > > Andrzej Kozlowski Toyama International University JAPAN http://sigma.tuins.ac.jp/ http://eri2.tuins.ac.jp/