Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6387

Re: Pattern to match element in nested list

From Ray Koopman <koopman@sfu.ca>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Pattern to match element in nested list
Date 2011-11-11 12:33 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j9j4nb$a71$1@smc.vnet.net> (permalink)
References <j9irl5$8ee$1@smc.vnet.net>

Show all headers | View raw


On Nov 11, 1:59 am, JasonE <ebaughja...@gmail.com> wrote:
> This is pretty basic and I am surprised at myself that I can't figure
> this out, but I guess its where I am at.
>
> What pattern would pick students with a score of zero out of this list
> (which is {"student", score}):
>
> {{"Smith, Tim",3},{"Wheres,Waldo",4},{"Muffet, LilMiss",0},{"Brown,
> Charlie",1},{"X, Doctor",0}}
>
> Thanks,
> Jason
>
> Contact: jasoneba...@jasonebaugh.info
> Blog:www.jasonebaugh.info/wordpress/
> LinkedIn:www.linkedin.com/in/jasonebaugh

Cases[{{"Smith, Tim",3},{"Wheres,Waldo",4},{"Muffet, LilMiss",0},
       {"Brown, Charlie",1},{"X, Doctor",0}}, {_,0}]

{{Muffet, LilMiss,0},{X, Doctor,0}}

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Pattern to match element in nested list JasonE <ebaughjason@gmail.com> - 2011-11-11 09:59 +0000
  Re: Pattern to match element in nested list Ray Koopman <koopman@sfu.ca> - 2011-11-11 12:33 +0000
  Re: Pattern to match element in nested list Peter Breitfeld <phbrf@t-online.de> - 2011-11-12 12:33 +0000
  Re: Pattern to match element in nested list "Dr. Wolfgang Hintze" <weh@snafu.de> - 2011-11-12 12:40 +0000

csiph-web