MathGroup Archive 2004

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

Search the Archive

Re: Union - simple question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49039] Re: Union - simple question
  • From: "Steve Luttrell" <steve_usenet at _removemefirst_luttrell.org.uk>
  • Date: Tue, 29 Jun 2004 04:50:19 -0400 (EDT)
  • References: <cbol4e$4e0$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

SameTest not Sametest

Steve Luttrell

"Steve Gray" <stevebg at adelphia.net> wrote in message
news:cbol4e$4e0$1 at smc.vnet.net...
> I don't understand why Union here doesn't work. (Sort is ok.)
> I want Union to eliminate list items where element [[1,2]] is
> duplicated. In this case, the first and third are duplicated because
> they both have '5' there.
>
>       ts = {{{1,2,3},5}, {{3,8,7},6}, {{7,8,9},5}, {{1,2,3},7}};
> Sort [ts, #1[[2]] < #2[[2]] &]
> Union[ts, Sametest -> (#1[[2]] == #2[[2]]&)]
>
> Any help will be appreciated.
>


  • Prev by Date: using updated Intel Math Kernel Library
  • Next by Date: Re: Union - simple question
  • Previous by thread: Re: Union - simple question
  • Next by thread: Re: Union - simple question