Mathematica 9 is now available
Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

Re: Keeping order with Union

  • To: mathgroup at
  • Subject: [mg32603] Re: Keeping order with Union
  • From: Jens-Peer Kuska <kuska at>
  • Date: Thu, 31 Jan 2002 01:45:28 -0500 (EST)
  • Organization: Universitaet Leipzig
  • References: <a38bd0$2n$>
  • Reply-to: kuska at
  • Sender: owner-wri-mathgroup at


look in the "Future Examples" of the Mathematica Online Help for Union[]

UnsortedUnion[x_] := Module[{f}, f[y_] := (f[y] = Sequence[]; y); f /@


Dave Snead wrote:
> I'd like a function that throws out duplicate entries in a list and keeps
> the
> original list order.  (when it sees 2 equal entries it throws out the one
> that is later in the list).   I'd use Union, but it sometimes changes the
> order of the elements in the list.  What's the tersest way to do this?
> Thanks in advance,
> Dave Snead

  • Prev by Date: Re: mice wheels
  • Next by Date: Re: Keeping order with Union
  • Previous by thread: Re: Keeping order with Union
  • Next by thread: Re: Keeping order with Union