In article <[EMAIL PROTECTED]>,
Edvard Majakari  <[EMAIL PROTECTED]> wrote:
>James Stroud <[EMAIL PROTECTED]> writes:
>>
>> from sets import Set
>>
>> data = [0.1,0.5,0.6,0.4,0.1,0.5,0.6,0.9]
>>
>> [x for x in Set(data) if data.count(x) == 1]
>
>Um.
>
>...I must have missed something, but I'll post nevertheless:
>
>wouldn't just
>
>[x for x in data if data.count(x) == 1]
>
>suffice? it is also "stable"  preserving order of items. Lemme demo:

Only for small datasets -- this is an O(N^2) algorithm.
-- 
Aahz ([EMAIL PROTECTED])           <*>         http://www.pythoncraft.com/

"And if that makes me an elitist...I couldn't be happier."  --JMS
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to