Skip to content

Commit

Permalink
fix jilin
Browse files Browse the repository at this point in the history
  • Loading branch information
advancehs committed Mar 18, 2023
1 parent 77819a3 commit b6088ab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions addana/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def _fill_city_map(city_map, record_dict):
pca_tuple = (record_dict[1], record_dict[2], record_dict[3])
city_map.append_relational_addr(city_name, pca_tuple, C)
# fix 吉林省、吉林市的混淆
# if city_name in filter_city_names:
# pass
if city_name in filter_city_names:
pass
if city_name.endswith(u'市'):
city_map.append_relational_addr(city_name[:-1], pca_tuple, C)
# 特别行政区
Expand Down Expand Up @@ -465,7 +465,7 @@ def _defer_set():


def pcaconcat(df,keep_col=2 ,*col,):

'''
df: 处理的表
keep_col: 要保留的到省(1)还是市(2)还是县(3)
Expand All @@ -491,15 +491,15 @@ def pcaconcat(df,keep_col=2 ,*col,):
if (df_["市"]=="").sum() >0: ## 查看省市为空的个数
index_error = df_[df_["市"]==""].index
df_.loc[index_error,"市"] = df_.loc[index_error,"区"]


if (df_["市"]=="").sum() >0:
print("注意,下面的行的市为空:" ,"\n",df_[df_["市"]==""].drop_duplicates())
else:
print("处理完毕,所有市都被识别")

df_.columns = ["prov_s","city_s","area_s","loca_s"]
df_.columns = ["prov_s","city_s","area_s","loca_s"]

return pd.concat([df,df_.iloc[:,0:keep_col]],axis=1).drop(columns=[*col])


1 change: 1 addition & 0 deletions docs/pca_202112.json

Large diffs are not rendered by default.

0 comments on commit b6088ab

Please sign in to comment.