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

MathGroup Archive 2007

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

Search the Archive

Re: Selecting Rows Where All Columns Satisfy a Condition

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82636] Re: Selecting Rows Where All Columns Satisfy a Condition
  • From: Bill Rowe <readnewsciv at sbcglobal.net>
  • Date: Fri, 26 Oct 2007 05:32:42 -0400 (EDT)

On 10/25/07 at 6:04 AM, gregory.lypny at videotron.ca (Gregory Lypny)
wrote:

>I've got an Nx4 numeric array called X.  I'd like to pull out all
>rows where -9 does not appear in any of the four columns.  I know I
>can this:

>Select[X, #[[1]] != -9 && #[[2]] != -9 && #[[3]] != -9 && #[[4]] !=
=
>-9 &]

>But is there a more elegant way that applies the not-equal-to
>condition to each column without having to repeat it?

=46or this class of problem I would use DeleteCases and pattern
matching, i.e.,

DeleteCases[X,{___,-9,___}]

should do the trick.
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: FullSimplify in functions
  • Next by Date: Re: FullSimplify in functions
  • Previous by thread: Re: Selecting Rows Where All Columns Satisfy a Condition
  • Next by thread: Re: Selecting Rows Where All Columns Satisfy a Condition