refactor: 优化数据处理逻辑和文档说明

- 移除首行跳过规则
- 更新使用说明文档,增加关于晋级晋档起始时间的运行规则说明
This commit is contained in:
Miu Li 2025-06-02 16:28:18 +08:00
parent 4cc8451c80
commit 758047085c
2 changed files with 6 additions and 6 deletions

View File

@ -25,11 +25,6 @@ BaseData = pd.read_excel("原数据.xlsx", sheet_name="入职信息")
Promote = pd.read_excel("原数据.xlsx", sheet_name="职务变动") #
Level_Limit = pd.read_excel("原数据.xlsx", sheet_name="职位规则",usecols="A:B", skiprows=2, names=["limit","role"])
BaseData = BaseData.drop(0)
BaseData = BaseData.reset_index(drop=True)
Promote = Promote.drop(0)
Promote = Promote.reset_index(drop=True)
for index, row in BaseData.iterrows():
for col in ["出生年月","任职年月","原职时间","参加工作时间","入职时间", "二档起始", "五档起始", "日期2"]:
BaseData.at[index, col] = custom_date_parser(row[col])
@ -211,6 +206,7 @@ for index, row in BaseData.iterrows():
promote = promote.sort_values(by="任职时间", ascending=False).reset_index(drop=True)
BaseData.at[index, "Latest_Role"] = promote.iloc[0]["新职务"]
BaseData.at[index, "Latest_Prom"] = promote.iloc[0]["任职时间"]
# 把原职务取出来
if promote.shape[0] > 1:
BaseData.at[index, "职务2"] = promote.iloc[1]["新职务"]
BaseData.at[index, "日期2"] = promote.iloc[1]["任职时间"]

View File

@ -31,7 +31,11 @@
所有日期在输出时会被格式化为“yyyy.mm”所以在填写的时候可以虚拟一个“日”但是请保留以保证是日期格式。
## 2. 打包成 .exe 文件
## 2. 运行规则
晋级晋档起始时间不会进行添加级别档次变化记录。
## 3. 打包成 .exe 文件
本程序使用Win7兼容的**Python 3.8.10**,需要在电脑上使用此版本,并确保打包的环境是此版本。