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

MathGroup Archive 2009

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

Search the Archive

RE : [mg96586] Select All Lists Where Any Element

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96624] RE : [mg96586] Select All Lists Where Any Element
  • From: "Jaccard Florian" <Florian.Jaccard at he-arc.ch>
  • Date: Tue, 17 Feb 2009 06:28:22 -0500 (EST)
  • References: <200902162140.QAA16030@smc.vnet.net>

X = {{1, 2, 3}, {8, NA, 20}, {-7, 9, NA}};

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

{{8, NA, 20}, {-7, 9, NA}}


Regards,

F.Jaccard

________________________________

De: Gregory Lypny [mailto:gregory.lypny at videotron.ca]
Date: lun. 16.02.2009 22:40
=C0: mathgroup at smc.vnet.net
Objet : [mg96586] Select All Lists Where Any Element is a Given Value



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
              





  • Prev by Date: Re: Select All Lists Where Any Element is a Given Value
  • Next by Date: Re: Select All Lists Where Any Element is a Given Value
  • Previous by thread: Re: Select All Lists Where Any Element is a Given Value
  • Next by thread: Re: Select All Lists Where Any Element is a Given Value