提交 14bb5abe 编写于 作者: F feilong

fix country

上级 d1d8b3e9
...@@ -43,16 +43,6 @@ def load_repo_github_popular_trends(config, ctx): ...@@ -43,16 +43,6 @@ def load_repo_github_popular_trends(config, ctx):
def load_repo_github_user_info(config, ctx): def load_repo_github_user_info(config, ctx):
# bar = None
# def show_pd_read_excel_progress(cur, tt):
# global bar
# if bar is None:
# bar = IncrementalBar("@开始加载用户仓库贡献表:", max=tt)
# else:
# bar.next(1)
schema = config["schema"] schema = config["schema"]
df = pd.read_excel( df = pd.read_excel(
schema["repo_github_user_info"]["file"], schema["repo_github_user_info"]["file"],
...@@ -221,15 +211,14 @@ def rank_personal_top_n(config, ctx): ...@@ -221,15 +211,14 @@ def rank_personal_top_n(config, ctx):
location = person['location'] location = person['location']
if location is not None and type(location) == type(""): if location is not None and type(location) == type(""):
# results = process.extract(
# location, district_pinyin_list, limit=1, scorer=fuzz.token_sort_ratio)
# print(results, location)
parts = location.split(",") parts = location.split(",")
for part in parts: for part in parts:
if district_pinyin_dict.get(part.strip().lower()) is not None: if district_pinyin_dict.get(part.strip().lower()) is not None:
person["country"] = "china" person["country"] = "china"
if person.get("country") is None: if person.get("country") is None:
person["country"] = "international" person["country"] = "international"
else:
person["country"] = "Null"
# 用户统计数据 # 用户统计数据
person['all_repo_contribute_total'] = int(row['sum_total']) person['all_repo_contribute_total'] = int(row['sum_total'])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册