修改统考数据导入的一个类型bug

This commit is contained in:
weiye.wang 2023-06-22 09:51:59 +08:00
parent cb7992a403
commit 45b14273e3
1 changed files with 7 additions and 6 deletions

View File

@ -1,7 +1,7 @@
texfile = r"D:\mathdeptv2\工具\临时文件\临时_学生用_20230621.tex"
excelfile = r"d:\temp\g2tk.xlsx"
date = "20230613"
grade = "2024届高二"
texfile = r"D:\mathdeptv2\工具\临时文件\临时_学生用_20230622.tex"
excelfile = r"C:\Users\weiye\Documents\wwy sync\临时工作区\高一期末.xlsx"
date = "20230620"
grade = "2025届高一"
sheetname = "难度统计"
max_classnum = 12
@ -37,8 +37,9 @@ for i in id_dict:
#生成行号与班级的对应列表
classrows_dict = {}
for row in df.iloc[:,0]:
if type(row) == int:
if 1<=int(row)<=12:
if type(row) == int or type(row) == float:
if 1<=row<=12:
row = int(row)
classrows_dict[list(df.iloc[:,0]).index(row)] = str(row).zfill(2) + ""
for cl in classrows_dict: