优化人均消费bug
This commit is contained in:
@@ -131,8 +131,10 @@ def sync(city=None):
|
|||||||
lng = commutils.format_lat_lng(item['lng'])
|
lng = commutils.format_lat_lng(item['lng'])
|
||||||
lat = commutils.format_lat_lng(item['lat'])
|
lat = commutils.format_lat_lng(item['lat'])
|
||||||
price = find_around_price(lng, lat)
|
price = find_around_price(lng, lat)
|
||||||
seaweed_df.loc[index, 'avg_cost'] = price
|
if price > 0:
|
||||||
|
seaweed_df.loc[index, 'avg_cost'] = price
|
||||||
|
else:
|
||||||
|
seaweed_df.loc[index, 'avg_cost'] = None
|
||||||
with ThreadPoolExecutor(max_workers=30) as pool:
|
with ThreadPoolExecutor(max_workers=30) as pool:
|
||||||
for index, item in seaweed_df.iterrows():
|
for index, item in seaweed_df.iterrows():
|
||||||
pool.submit(find_around_price_item, index, item)
|
pool.submit(find_around_price_item, index, item)
|
||||||
|
|||||||
Reference in New Issue
Block a user