refactor: 优化数据处理逻辑和文档说明
- 移除首行跳过规则 - 更新使用说明文档,增加关于晋级晋档起始时间的运行规则说明
This commit is contained in:
parent
4cc8451c80
commit
758047085c
6
main.py
6
main.py
@ -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]["任职时间"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user