From 14bb5abe2fb2949e10139c08daa510cfe48def8a Mon Sep 17 00:00:00 2001 From: feilong Date: Tue, 18 Oct 2022 20:54:55 +0800 Subject: [PATCH] fix country --- src/tasks/ranks.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/tasks/ranks.py b/src/tasks/ranks.py index 8d89642..ee02bcd 100644 --- a/src/tasks/ranks.py +++ b/src/tasks/ranks.py @@ -43,16 +43,6 @@ def load_repo_github_popular_trends(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"] df = pd.read_excel( schema["repo_github_user_info"]["file"], @@ -221,15 +211,14 @@ def rank_personal_top_n(config, ctx): location = person['location'] 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(",") for part in parts: if district_pinyin_dict.get(part.strip().lower()) is not None: person["country"] = "china" - if person.get("country") is None: - person["country"] = "international" + if person.get("country") is None: + person["country"] = "international" + else: + person["country"] = "Null" # 用户统计数据 person['all_repo_contribute_total'] = int(row['sum_total']) -- GitLab