Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: Select from a list

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

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
Examples.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

From: Feng-Yin Chang [mailto:fychang at slac.stanford.edu]
To: mathgroup at smc.vnet.net

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