fix: 报告水色指数模式 stats_data 补全缺失的统计字段
水色指数模式 stats_data 只复制了 参数/点位数, 缺少 最小值/最大值/平均值/标准差 → _analyze_statistics 访问时 KeyError: '最小值'
This commit is contained in:
@ -1724,7 +1724,11 @@ class WaterQualityReportGenerator:
|
||||
row_cells = table.add_row().cells
|
||||
for j, (col_name, hdr_name) in enumerate(header_map.items()):
|
||||
row_cells[j].text = str(row_dict.get(col_name, ''))
|
||||
stats_data = [{'参数': r['参数'], '点位数': r['数量']} for r in stats_rows]
|
||||
stats_data = [{
|
||||
'参数': r['参数'], '点位数': r['数量'],
|
||||
'最小值': str(r['最小值']), '最大值': str(r['最大值']),
|
||||
'平均值': str(r['平均值']), '标准差': str(r['标准差']),
|
||||
} for r in stats_rows]
|
||||
else:
|
||||
# ML 模式:逐列统计
|
||||
stats_data = []
|
||||
|
||||
Reference in New Issue
Block a user