Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Select All Lists Where Any Element is a Given Value

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96600] Re: [mg96586] Select All Lists Where Any Element is a Given Value
  • From: Curtis Osterhoudt <cfo at lanl.gov>
  • Date: Tue, 17 Feb 2009 06:23:57 -0500 (EST)
  • Organization: LANL
  • References: <200902162140.QAA16030@smc.vnet.net>
  • Reply-to: cfo at lanl.gov

Select[X, MemberQ[#, NA] &]

            Regards, 
                        C.O.

On Monday 16 February 2009 02:40:47 pm Gregory Lypny wrote:
> Hello everyone,
> 
> Suppose I have the list
> 
> 	X = {{1, 2, 3}, {8, NA, 20}, {-7, 9, NA}},
> 
> where NA is a string, although it need not be.  How can I use Select  
> to pull out all lists in X where NA appears in any element?  In this  
> example, I want to pull out the second and third list.
> 
> 		Regards,
> 
> 			Gregory
> 		
> 
> 



-- 
==========================================================
Curtis Osterhoudt
cfo at remove_this.lanl.and_this.gov
PGP Key ID: 0x4DCA2A10
Please avoid sending me Word or PowerPoint attachments
See http://www.gnu.org/philosophy/no-word-attachments.html
==========================================================


  • Prev by Date: RE : [mg96586] Select All Lists Where Any Element
  • Next by Date: Re: Problem with the 'if' command
  • Previous by thread: RE : [mg96586] Select All Lists Where Any Element
  • Next by thread: Re: Select All Lists Where Any Element is a Given Value