MathGroup Archive 2004

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

Search the Archive

Re: Select from a list

  • To: mathgroup at
  • Subject: [mg49880] Re: [mg49856] Select from a list
  • From: "David Park" <djmp at>
  • Date: Thu, 5 Aug 2004 09:20:47 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Just use Union.

{1, 1, 2, 2, 4, 6, 6, 8, 8, 9} // Union
{1, 2, 4, 6, 8, 9}

If your elements are not in sorted order and you want to keep them in the
same order, then look at the UnsortedUnion example in the Union Help

David Park
djmp at

From: Feng-Yin Chang [mailto:fychang at]
To: mathgroup at

Hi everyone,

   Does anyone have an idea to drop the repeating elements in one list?
   The list was built in sequence,fortunately.

   for example,
   from a={1,1,2,2,4,6,6,8,8,9}
   to a1={1,2,4,6,8,9}

  The purpose is to avoid the one-to-many mapping problem in my case.

Feng-Yin Chang,
Institute of Physics,NCTU,Taiwan

  • Prev by Date: Re: Select from a list
  • Next by Date: Re: Select from a list
  • Previous by thread: Re: Select from a list
  • Next by thread: Recursion depth