MathGroup Archive 2008

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

Search the Archive

Re: DeleteCases and multiple patterns

  • To: mathgroup at smc.vnet.net
  • Subject: [mg93982] Re: [mg93936] DeleteCases and multiple patterns
  • From: "Thomas Dowling" <thomasgdowling at gmail.com>
  • Date: Sun, 30 Nov 2008 07:01:11 -0500 (EST)
  • References: <200811290929.EAA14420@smc.vnet.net>

Hello,

If I have interpreted you correctly:

myList = {{1, y1, z1}, {2, y2, z1}, {3, y3, z3}, {4, y4, z4}};

In[36]= DeleteCases[myList, {3 | 2, _, _}]

Out[36]= {{1, y1, z1}, {4, y4, z4}}

(Mathematica 6.0)

Tom Dowling

On Sat, Nov 29, 2008 at 9:29 AM, guerom00 <guerom00 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: DeleteCases and multiple patterns
  • Next by Date: Re: How to hold a form and convert it to a string
  • Previous by thread: Re: DeleteCases and multiple patterns
  • Next by thread: Re: DeleteCases and multiple patterns