MathGroup Archive 2012

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

Search the Archive

Re: Intersection problem


Cisco:

Select[{{a,x},{b,y},{c,z}},MemberQ[#,(b|c|d)]&]

	Best,

	Harvey


-----Original Message-----
From: Cisco Lane [mailto:travlorf at yahoo.com]
Sent: Tuesday, April 10, 2012 2:27 AM
To: mathgroup at smc.vnet.net
Subject: [mg125973] Intersection problem

I need to select out the elements of the first list whose first elements
are contained in the second list. For example

first list: {{a,x},{b,y},{c,z}}

second list: {b,c,d}

result: {{b,y},{c,z}}

Is there a quick way to do this? Intersection, maybe somehow?




  • Prev by Date: Re: Intersection problem
  • Next by Date: Re: Intersection problem
  • Previous by thread: Re: Intersection problem
  • Next by thread: Re: Intersection problem