Re: Parts of a list
- To: mathgroup at smc.vnet.net
- Subject: [mg15536] Re: [mg15430] Parts of a list
- From: jtischer at col2.telecom.com.co (Cl-Jurgen Tischer)
- Date: Tue, 26 Jan 1999 13:44:26 -0500 (EST)
- Organization: Universidad del Valle
- References: <199901140157.UAA02693@smc.vnet.net.>
- Sender: owner-wri-mathgroup at wolfram.com
Hossein, In[1]:= Select[x,#[[2]]!=0&] Out[1]= {{2.5,0.5},{0,2}} In[2]:= DeleteCases[x,{_,0}] Out[2]= {{2.5,0.5},{0,2}} In[3]:= Cases[x,{_,_?(#!=0&)}] Out[3]= {{2.5,0.5},{0,2}} Jurgen Hossein Kazemi 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
- References:
- Parts of a list
- From: "Hossein Kazemi" <kazemi@som.umass.edu>
- Parts of a list