|
@@ -186,7 +186,7 @@ def getImg(x,y,url,name,sheetName,xLabel,YLabel,numArr,fileUrl,loc):
|
|
y_pred = model.predict(x.to_numpy().reshape(-1, 1))
|
|
y_pred = model.predict(x.to_numpy().reshape(-1, 1))
|
|
fig.add_trace(go.Scatter(x=x, y=y_pred, mode='lines', name='拟合直线'))
|
|
fig.add_trace(go.Scatter(x=x, y=y_pred, mode='lines', name='拟合直线'))
|
|
|
|
|
|
- html_file_path = f"{url}/{name}频度统计图.html"
|
|
|
|
|
|
+ html_file_path = f"{url}/{name}.html"
|
|
pio.write_html(fig, file=html_file_path, auto_open=False)
|
|
pio.write_html(fig, file=html_file_path, auto_open=False)
|
|
# 在表格中插入html
|
|
# 在表格中插入html
|
|
workbook = load_workbook(filename=fileUrl)
|
|
workbook = load_workbook(filename=fileUrl)
|
|
@@ -1226,10 +1226,10 @@ def getReport(originData,data,changeFileUrl, saveFileUrl, check_1_data,
|
|
paragraph_t_12.add_run(f'图12:全盐量分布图').bold = True
|
|
paragraph_t_12.add_run(f'图12:全盐量分布图').bold = True
|
|
paragraph_t_12.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
paragraph_t_12.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
|
|
|
|
- if os.path.isfile(f'{mkdir_path}/全盐量与电导率相关性分析图.png'):
|
|
|
|
- doc.add_picture(f'{mkdir_path}/全盐量与电导率相关性分析图.png', width=Inches(6.0))
|
|
|
|
|
|
+ if os.path.isfile(f'{mkdir_path}/全盐量与电导率相关性散点图.png'):
|
|
|
|
+ doc.add_picture(f'{mkdir_path}/全盐量与电导率相关性散点图.png', width=Inches(6.0))
|
|
paragraph_t_13 = doc.add_paragraph()
|
|
paragraph_t_13 = doc.add_paragraph()
|
|
- paragraph_t_13.add_run(f'图13:全盐量与电导率相关性分析图').bold = True
|
|
|
|
|
|
+ paragraph_t_13.add_run(f'图13:全盐量与电导率相关性散点图').bold = True
|
|
paragraph_t_13.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
paragraph_t_13.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
|
|
|
|
|
if os.path.isfile(f'{mkdir_path}/离子总量与水溶性盐总量关系图.png'):
|
|
if os.path.isfile(f'{mkdir_path}/离子总量与水溶性盐总量关系图.png'):
|
|
@@ -1866,7 +1866,7 @@ def saveFile():
|
|
nowTable_sr = pd.read_excel(mkdir_path + '/土壤水溶性盐数据-' + nowTime + '.xlsx',
|
|
nowTable_sr = pd.read_excel(mkdir_path + '/土壤水溶性盐数据-' + nowTime + '.xlsx',
|
|
sheet_name='水溶性盐数据')
|
|
sheet_name='水溶性盐数据')
|
|
imgData_sr = nowTable_sr.dropna(subset=['水溶性全盐量g/kg', '电导率ms/cm'])
|
|
imgData_sr = nowTable_sr.dropna(subset=['水溶性全盐量g/kg', '电导率ms/cm'])
|
|
- getImg(imgData_sr['水溶性全盐量g/kg'],imgData_sr['电导率ms/cm'],mkdir_path,'全盐量与电导率相关性分析图',
|
|
|
|
|
|
+ getImg(imgData_sr['水溶性全盐量g/kg'],imgData_sr['电导率ms/cm'],mkdir_path,'全盐量与电导率相关性散点图',
|
|
'水溶性盐数据', '水溶性全盐量g/kg','电导率ms/cm',
|
|
'水溶性盐数据', '水溶性全盐量g/kg','电导率ms/cm',
|
|
imgData_sr['样品编号'],mkdir_path + '/土壤水溶性盐数据-' + nowTime + '.xlsx','T1')
|
|
imgData_sr['样品编号'],mkdir_path + '/土壤水溶性盐数据-' + nowTime + '.xlsx','T1')
|
|
getStatisticsImg(nowTable_sr['水溶性全盐量g/kg'], '水溶性全盐量g/kg', '水溶性全盐量',
|
|
getStatisticsImg(nowTable_sr['水溶性全盐量g/kg'], '水溶性全盐量g/kg', '水溶性全盐量',
|
|
@@ -1885,11 +1885,11 @@ def saveFile():
|
|
imgData_NPK = nowTable_NPK.dropna(subset=['有机质g/kg', '全氮g/kg'])
|
|
imgData_NPK = nowTable_NPK.dropna(subset=['有机质g/kg', '全氮g/kg'])
|
|
cationImgData = nowTable_NPK.dropna(subset=['有机质g/kg', '阳离子交换量'])
|
|
cationImgData = nowTable_NPK.dropna(subset=['有机质g/kg', '阳离子交换量'])
|
|
if not imgData_NPK.empty:
|
|
if not imgData_NPK.empty:
|
|
- getImg(imgData_NPK['有机质g/kg'],imgData_NPK['全氮g/kg'],mkdir_path,'有机质和全氮相关性分析图','土壤氮磷钾数据',
|
|
|
|
|
|
+ getImg(imgData_NPK['有机质g/kg'],imgData_NPK['全氮g/kg'],mkdir_path,'有机质和全氮相关性散点图','土壤氮磷钾数据',
|
|
'有机质g/kg','全氮g/kg',imgData_NPK['编号'],mkdir_path + '/土壤氮磷钾数据-' + nowTime + '.xlsx','P1')
|
|
'有机质g/kg','全氮g/kg',imgData_NPK['编号'],mkdir_path + '/土壤氮磷钾数据-' + nowTime + '.xlsx','P1')
|
|
if not cationImgData.empty:
|
|
if not cationImgData.empty:
|
|
getImg(cationImgData['有机质g/kg'], cationImgData['阳离子交换量'], mkdir_path,
|
|
getImg(cationImgData['有机质g/kg'], cationImgData['阳离子交换量'], mkdir_path,
|
|
- '有机质和阳离子交换量相关性分析图',
|
|
|
|
|
|
+ '有机质和阳离子交换量相关性散点图',
|
|
'土壤氮磷钾数据',
|
|
'土壤氮磷钾数据',
|
|
'有机质g/kg', '阳离子交换量', cationImgData['编号'],
|
|
'有机质g/kg', '阳离子交换量', cationImgData['编号'],
|
|
mkdir_path + '/土壤氮磷钾数据-' + nowTime + '.xlsx',
|
|
mkdir_path + '/土壤氮磷钾数据-' + nowTime + '.xlsx',
|