From 027ae0d108b2776d5c330760856ae3f1960df9b5 Mon Sep 17 00:00:00 2001 From: mxr612 Date: Mon, 2 Jun 2025 22:41:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=99=8B=E5=8D=87?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=BC=BA=E5=A4=B1=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在处理晋升信息时,添加了对职务2和日期2的默认值设置,确保在晋升记录不足时使用初始职务和入职时间填充相关字段。 --- main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.py b/main.py index a550ea4..a694fc2 100644 --- a/main.py +++ b/main.py @@ -210,6 +210,9 @@ for index, row in BaseData.iterrows(): if promote.shape[0] > 1: BaseData.at[index, "职务2"] = promote.iloc[1]["新职务"] BaseData.at[index, "日期2"] = promote.iloc[1]["任职时间"] + else: + BaseData.at[index, "职务2"] = row["初始职务"] + BaseData.at[index, "日期2"] = row["入职时间"] promote = promote.sort_values(by="任职时间").reset_index(drop=True) fill_prompt_info(ws, promote)# 填充晋升信息