MathGroup Archive 2009

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

Search the Archive

Re: from the list select


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