MathGroup Archive 2012

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

Search the Archive

Re: Intersection problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125973] Re: Intersection problem
  • From: "Harvey P. Dale" <hpd1 at nyu.edu>
  • Date: Wed, 11 Apr 2012 18:14:57 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201204100627.CAA10654@smc.vnet.net>

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