MathGroup Archive 2007

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

Search the Archive

Re: Deleting duplicates from a list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76023] Re: Deleting duplicates from a list
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Tue, 15 May 2007 04:45:25 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <f292sh$m3p$1@smc.vnet.net>

Raul Martinez wrote:
> Hi all,
> 
> I have a list, e.g., {8, 8, 11, 11, 19}. I want to eliminate all  
> duplicates so the list becomes {8, 11, 19}. Can anyone suggest a  
> command that will do this?
> 
> TIA,
> 
> Raul Martinez
> 

Union is what you are looking for.

Union[{8, 8, 11, 11, 19}]

==> {8, 11, 19}

Regards,
Jean-Marc


  • Prev by Date: Re: Solve & RotationMatrix
  • Next by Date: About UnitStep and ZeroValue
  • Previous by thread: Re: Deleting duplicates from a list
  • Next by thread: Re: Deleting duplicates from a list