Norman Khine wrote:
> Here is the latest version http://pastie.org/1066582 can this be
> further improved?
> # get all the duplicates and clean the products table
> main.execute("SELECT product_Id, url FROM %s.product WHERE url != ''" %
db)
> results = main.fetchall()
>
> d = defaultdict(set)
>
Hello,
Thanks for the replies.
On Thu, Jul 29, 2010 at 7:10 PM, Gregory, Matthew
wrote:
> Norman Khine wrote:
>> basically i have two tables:
>>
>> id, url
>> 24715L, 'http://aqoon.local/muesli/2-muesli-tropical-500g.html'
>> 24719L, 'http://aqoon.local/muesli/2-muesli-tropical-500g.html'
>>
>> i
Norman Khine wrote:
> basically i have two tables:
>
> id, url
> 24715L, 'http://aqoon.local/muesli/2-muesli-tropical-500g.html'
> 24719L, 'http://aqoon.local/muesli/2-muesli-tropical-500g.html'
>
> id, tid,
> 1, 24715L
> 2, 24719L
>
> so i want to first update t(2)'s tid to t(1)'s id for each d
Norman Khine wrote:
> hello,
>
> i have this tuple:
>
> http://paste.lisp.org/+2F4X
>
> i have this, which does what i want:
>
> from collections import defaultdict
>
> d = defaultdict(set)
> for id, url in result:
> d[url].add(id)
> for url in sorted(d):
> if len(d[url]) > 1:
> print('%d --
hello,
i have this tuple:
http://paste.lisp.org/+2F4X
i have this, which does what i want:
from collections import defaultdict
d = defaultdict(set)
for id, url in result:
d[url].add(id)
for url in sorted(d):
if len(d[url]) > 1:
print('%d -- %s' % (len(d[url]), u