dicts の 2 つのリストがあります: prices_distincts
, prices
.
それらは を介して接続されhash_brand_artnum
、両方とも次のようにソートされhash_brand_artnum
ています。
長さ
prices_distincts
が100,000の場合、それは機能します30 min
ただし、長さ
prices_distincts
が 10,000 の場合は で機能し10 sec
ます。
コード:
prices_distincts = [{'hash_brand_artnum':1202},...,..]
prices = [{'hash_brand_artnum':1202,'price':12.077},...,...]
for prices_distinct in prices_distincts:
for price in list(prices):
if prices_distinct['hash_brand_artnum'] == price['hash_brand_artnum']:
print price['hash_brand_artnum']
#print prices
del prices[0]
else:
continue
同じ価格の商品を探す必要があります。price_distincts と価格の 1 対多の関係。同一価格のグループ価格['hash_brand_artnum']