Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14861 > unrolled thread

Re: Removing list elements in x by list y

Started byTomas Garza <tgarza10@msn.com>
First post2013-06-14 08:54 +0000
Last post2013-06-14 08:54 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Removing list elements in x by list y Tomas Garza <tgarza10@msn.com> - 2013-06-14 08:54 +0000

#14861 — Re: Removing list elements in x by list y

FromTomas Garza <tgarza10@msn.com>
Date2013-06-14 08:54 +0000
SubjectRe: Removing list elements in x by list y
Message-ID<kpeloh$htf$1@smc.vnet.net>
In[1]:=Select[x, !MemberQ[y, #]&]
Out[1]= {v,w,w}

-Tomas

> From: weh@snafu.de
> Subject: Removing list elements in x by list y
> To: mathgroup@smc.vnet.net
> Date: Thu, 13 Jun 2013 02:36:35 -0400
>
> I have simple question.
>
> Given two lists
>
> x = {u, v, w, w, d};
> y = {u, d};
>
> I wish to "subtract" y from x, i.e. remove exactly the elements in x
> which belong to y giving
>
> x "-" y = {v,w,w}
>
> Complement[] gives instead {v,w}.
> Note that we are talking about lists rather than sets.
>
> I'm sure there is a simple standard command, but I can't find it.
> Can you?
>
> Regards,
> Wolfgang
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web