Unique Elements in a List

Max M maxm at mxm.dk
Tue May 10 04:01:09 EDT 2005


Fredrik Lundh wrote:

> depending on the data, it might be more efficient to store the
> "last seen index" in a dictionary, and sort the result on the way
> out (if necessary).  something like


form sets import Set

data = list(Set([0.1,0.5,0.6,0.4,0.1,0.5,0.6,0.9]))


-- 

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science



More information about the Python-list mailing list