MathGroup Archive 2009

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

Search the Archive

Re: from the list select

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101082] Re: from the list select
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Tue, 23 Jun 2009 07:08:06 -0400 (EDT)
  • References: <h1nf1q$941$1@smc.vnet.net>

Hi,

Select[namedata, #[[3]] === "P" &]

or

Reap[If[#[[3]] === "P", Sow[#]] & /@ namedata][[2]]

or

Cases[namedata, {__, "P"}]

or

namedata /. {_, _, c : Except["P"]} :> Sequence[]

or

Part[namedata, Sequence @@ Position[namedata, {__, "P"}]]

and several more possibilities.

Regards
   Jens


terrie riley wrote:
> from this list select the person who has P in the third position
> 
> 
> namedata = {{"Aardsma", "David", "P"},{"Bay", "Jason", "OF"}}
> 


  • Prev by Date: Matrix construction
  • Next by Date: For loops with mathematica....
  • Previous by thread: Re: from the list select
  • Next by thread: Re: from the list select