database_tools新增usagelistdifference比较两个正确率记录列表(可多小题)的差异
This commit is contained in:
parent
3d664d7816
commit
6f1c68c8e4
|
|
@ -2170,5 +2170,15 @@ def PaintRedAnswers(string,prodict): #将prodict中已有的答案标红色
|
|||
return output
|
||||
|
||||
|
||||
def usagelistdifference(lista,listb): #比较两个usage数组的最大差别(绝对值), 数组长度不一致则返回1
|
||||
if len(lista) != len(listb):
|
||||
return 1
|
||||
else:
|
||||
maxdiff = 0
|
||||
for i in range(len(lista)):
|
||||
maxdiff = max(abs(float(lista[i])-float(listb[i])),maxdiff)
|
||||
return maxdiff
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("数据库工具, import用.")
|
||||
Reference in New Issue