新增企业库处理流程
This commit is contained in:
@@ -11,7 +11,30 @@ flag = False
|
||||
for province in areautils.get_all_province():
|
||||
print(f"开始处理{province}数据")
|
||||
# 百度经纬度转高德经纬度
|
||||
df = DIDATA_DEV_ELASTIC_CLIENT.scan_by_sql_to_data_frame(f"select location from didata_enterprise where province='{province}'")
|
||||
df = DIDATA_DEV_ELASTIC_CLIENT.scan_to_data_frame(index='didata_enterprise', query={
|
||||
"query": {
|
||||
"bool": {
|
||||
"must": [
|
||||
{
|
||||
"term": {
|
||||
"province": {
|
||||
"value": "" + province + ""
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"must_not": [
|
||||
{
|
||||
"exists": {
|
||||
"field": "gaode_location"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
})
|
||||
if len(df) == 0:
|
||||
continue
|
||||
def deal_location(item):
|
||||
if pd.isna(item['location']):
|
||||
return item
|
||||
|
||||
Reference in New Issue
Block a user