Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9568 > unrolled thread
| Started by | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| First post | 2012-04-11 22:25 +0000 |
| Last post | 2012-04-11 22:25 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Intersection problem Bill Rowe <readnews@sbcglobal.net> - 2012-04-11 22:25 +0000
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Date | 2012-04-11 22:25 +0000 |
| Subject | Re: Intersection problem |
| Message-ID | <jm50cc$2pr$1@smc.vnet.net> |
On 4/10/12 at 2:27 AM, travlorf@yahoo.com (Cisco Lane) wrote:
>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?
In[1]:= Cases[{{a, x}, {b, y}, {c,
z}}, _?(Intersection[#, {b, c, d}] != {} &)]
Out[1]= {{b, y}, {c, z}}
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web