Removing list elements in x by list y
- To: mathgroup at smc.vnet.net
- Subject: [mg131122] Removing list elements in x by list y
- From: "Dr. Wolfgang Hintze" <weh at snafu.de>
- Date: Thu, 13 Jun 2013 02:36:35 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
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
- Follow-Ups:
- Re: Removing list elements in x by list y
- From: Tomas Garza <tgarza10@msn.com>
- Re: Removing list elements in x by list y
- From: Ulrich Arndt <ulrich.arndt@data2knowledge.de>
- Re: Removing list elements in x by list y
- From: Bob Hanlon <hanlonr357@gmail.com>
- Re: Removing list elements in x by list y