两个csv和一个excel



需要了解如何比较两个技术上相同的json文件并输出它们之间的差异。

diff = {}
for k, v in ref.items():
diff[k] = {}
for key, ref_value in v.items():
if key in exact_match_keys:
if ref_value == samp[k][key]:
diff[k][key] = "matched"
else:
diff[k][key] = "Not Matched"
elif key in percent_match_keys:
ref_n, samp_n = float(ref_value), float(samp[k][key])
p_dif = abs(ref_n - samp_n) / ref_n * 100
diff[k][key] = f"%{p_dif} difference"

相关内容

  • 没有找到相关文章

最新更新