Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: DeleteCases and multiple patterns

  • To: mathgroup at smc.vnet.net
  • Subject: [mg93963] Re: DeleteCases and multiple patterns
  • From: "sjoerd.c.devries at gmail.com" <sjoerd.c.devries at gmail.com>
  • Date: Sun, 30 Nov 2008 06:57:36 -0500 (EST)
  • References: <ggr217$e21$1@smc.vnet.net>

DeleteCases[myList, {1 | 2, _, _}] or

DeleteCases[myList, {x_, _, _} /; (x == 1 || x == 2)]

Cheers -- Sjoerd

On Nov 29, 11:29 am, guerom00 <guero... at gmail.com> wrote:
> Hello everyone :)
>
> I have, say a list of list. Each element is a list of length 3 i.e.
>
> myList={{x1,y1,z1},{x2,y2,z2},...{xN,yN,zN}}
>
> Now, let's say I want to delete from this list the element which have
> x=2 and 3 using DeleteCases.
> This works :
>
> DeleteCase[myList,{2,_,_}]
> DeleteCases[myList,{3,_,_}]
>
> but I would like to use
>
> DeleteCases[myList,{{2,_,_},{3,_,_}}]
>
> and this does not work...
>
> How do I combine multiple patterns in DeleteCases ?
>
> Thanks in advance.



  • Prev by Date: Re: Re: Re: v.7.0 issues
  • Next by Date: Re: DeleteCases and multiple patterns
  • Previous by thread: Re: DeleteCases and multiple patterns
  • Next by thread: Re: DeleteCases and multiple patterns