|
@@ -12,7 +12,7 @@ def soil_bulk_density(arr): #arr为计算过的数组
|
|
try:
|
|
try:
|
|
for i in arr['土壤容重平均值(g/cm3)(计算)']:
|
|
for i in arr['土壤容重平均值(g/cm3)(计算)']:
|
|
if i > 1.6 or i < 0.8:
|
|
if i > 1.6 or i < 0.8:
|
|
- shenHeList.append('土壤容重:超阈值。')
|
|
|
|
|
|
+ shenHeList.append('土壤容重:复核数据合理性。')
|
|
shenHeTarget.append('土壤容重平均值。')
|
|
shenHeTarget.append('土壤容重平均值。')
|
|
else:
|
|
else:
|
|
shenHeList.append('')
|
|
shenHeList.append('')
|
|
@@ -42,7 +42,7 @@ def soil_bulk_density(arr): #arr为计算过的数组
|
|
try:
|
|
try:
|
|
for i in arr['加和%']:
|
|
for i in arr['加和%']:
|
|
if float(i) > 100.02 or float(i) < 99.98:
|
|
if float(i) > 100.02 or float(i) < 99.98:
|
|
- plusShenHeList.append('土壤颗粒加和:超阈值。')
|
|
|
|
|
|
+ plusShenHeList.append('土壤颗粒加和:复核数据合理性。')
|
|
plusShenHeTarget.append('土壤颗粒含量加和。')
|
|
plusShenHeTarget.append('土壤颗粒含量加和。')
|
|
else:
|
|
else:
|
|
plusShenHeList.append('')
|
|
plusShenHeList.append('')
|
|
@@ -157,7 +157,7 @@ def water_stable(arr):
|
|
# shenHeTar.append('')
|
|
# shenHeTar.append('')
|
|
# 规则2判断
|
|
# 规则2判断
|
|
if row['总和(%)'] > 60 or row['总和(%)'] < 1:
|
|
if row['总和(%)'] > 60 or row['总和(%)'] < 1:
|
|
- plusList.append('水稳性大团聚体:总和超阈值。')
|
|
|
|
|
|
+ plusList.append('水稳性大团聚体:总和复核数据合理性。')
|
|
plusTar.append('水稳总和。')
|
|
plusTar.append('水稳总和。')
|
|
else:
|
|
else:
|
|
plusList.append('')
|
|
plusList.append('')
|
|
@@ -343,56 +343,56 @@ def cation_value(arr):
|
|
for index, row in arr.iterrows():
|
|
for index, row in arr.iterrows():
|
|
# 风干样含水量 0.5-5,存疑
|
|
# 风干样含水量 0.5-5,存疑
|
|
if pd.isna(row['含水量']) or row['含水量'] > 5 or row['含水量'] < 0.5:
|
|
if pd.isna(row['含水量']) or row['含水量'] > 5 or row['含水量'] < 0.5:
|
|
- waterMount.append('风干试样含水量(分析基):超阈值。')
|
|
|
|
|
|
+ waterMount.append('风干试样含水量(分析基):复核数据合理性。')
|
|
waterMountTar.append('风干试样含水量(分析基)。')
|
|
waterMountTar.append('风干试样含水量(分析基)。')
|
|
else:
|
|
else:
|
|
waterMount.append('')
|
|
waterMount.append('')
|
|
waterMountTar.append('')
|
|
waterMountTar.append('')
|
|
# (1)pH在[4, 9]范围之外的,存疑;
|
|
# (1)pH在[4, 9]范围之外的,存疑;
|
|
if pd.isna(row['pH']) or row['pH'] < 4 or row['pH'] > 9:
|
|
if pd.isna(row['pH']) or row['pH'] < 4 or row['pH'] > 9:
|
|
- phList.append('pH:超阈值。')
|
|
|
|
|
|
+ phList.append('pH:复核数据合理性。')
|
|
phTar.append('pH。')
|
|
phTar.append('pH。')
|
|
else:
|
|
else:
|
|
phList.append('')
|
|
phList.append('')
|
|
phTar.append('')
|
|
phTar.append('')
|
|
# (2)阳离子交换量在[6, 38]范围之外的,存疑;
|
|
# (2)阳离子交换量在[6, 38]范围之外的,存疑;
|
|
if row['阳离子交换量Cmol(+)/kg'] < 6 or row['阳离子交换量Cmol(+)/kg'] > 38:
|
|
if row['阳离子交换量Cmol(+)/kg'] < 6 or row['阳离子交换量Cmol(+)/kg'] > 38:
|
|
- cationList.append('阳离子交换量:超阈值。')
|
|
|
|
|
|
+ cationList.append('阳离子交换量:复核数据合理性。')
|
|
cationTar.append('阳离子交换量。')
|
|
cationTar.append('阳离子交换量。')
|
|
else:
|
|
else:
|
|
cationList.append('')
|
|
cationList.append('')
|
|
cationTar.append('')
|
|
cationTar.append('')
|
|
# (3)交换性盐基总量在[3, 30]范围之外的,存疑;
|
|
# (3)交换性盐基总量在[3, 30]范围之外的,存疑;
|
|
if row['交换性盐总量Cmol(+)/kg'] <3 or row['交换性盐总量Cmol(+)/kg'] > 30:
|
|
if row['交换性盐总量Cmol(+)/kg'] <3 or row['交换性盐总量Cmol(+)/kg'] > 30:
|
|
- exchangeableSalt.append('交换性盐基总量:超阈值。')
|
|
|
|
|
|
+ exchangeableSalt.append('交换性盐基总量:复核数据合理性。')
|
|
exchangeableSaltTar.append('交换性盐总量。')
|
|
exchangeableSaltTar.append('交换性盐总量。')
|
|
else:
|
|
else:
|
|
exchangeableSalt.append('')
|
|
exchangeableSalt.append('')
|
|
exchangeableSaltTar.append('')
|
|
exchangeableSaltTar.append('')
|
|
# (4)交换性钙在[1, 25]范围之外的,存疑;
|
|
# (4)交换性钙在[1, 25]范围之外的,存疑;
|
|
if row['交换性钙Cmol(1/2Ca2+)/kg'] < 1 or row['交换性钙Cmol(1/2Ca2+)/kg'] > 25:
|
|
if row['交换性钙Cmol(1/2Ca2+)/kg'] < 1 or row['交换性钙Cmol(1/2Ca2+)/kg'] > 25:
|
|
- exchangeableCa.append('交换性钙:交换性钙超阈值。')
|
|
|
|
|
|
+ exchangeableCa.append('交换性钙:交换性钙复核数据合理性。')
|
|
exchangeableCaTar.append('交换性钙。')
|
|
exchangeableCaTar.append('交换性钙。')
|
|
else:
|
|
else:
|
|
exchangeableCa.append('')
|
|
exchangeableCa.append('')
|
|
exchangeableCaTar.append('')
|
|
exchangeableCaTar.append('')
|
|
# (5)交换性镁在[0.5, 12.5]范围之外的,存疑;
|
|
# (5)交换性镁在[0.5, 12.5]范围之外的,存疑;
|
|
if row['交换性镁cmol(1/2Mg2+)/kg'] < 0.5 or row['交换性镁cmol(1/2Mg2+)/kg'] > 12.8:
|
|
if row['交换性镁cmol(1/2Mg2+)/kg'] < 0.5 or row['交换性镁cmol(1/2Mg2+)/kg'] > 12.8:
|
|
- exchangeableMg.append('交换性镁:超阈值。')
|
|
|
|
|
|
+ exchangeableMg.append('交换性镁:复核数据合理性。')
|
|
exchangeableMgTar.append('交换性镁。')
|
|
exchangeableMgTar.append('交换性镁。')
|
|
else:
|
|
else:
|
|
exchangeableMg.append('')
|
|
exchangeableMg.append('')
|
|
exchangeableMgTar.append('')
|
|
exchangeableMgTar.append('')
|
|
# (6)交换性钾在[0.1, 1.5]范围之外的,存疑;
|
|
# (6)交换性钾在[0.1, 1.5]范围之外的,存疑;
|
|
if row['交换性钾Cmol(+)/kg'] < 0.1 or row['交换性钾Cmol(+)/kg'] > 1.5:
|
|
if row['交换性钾Cmol(+)/kg'] < 0.1 or row['交换性钾Cmol(+)/kg'] > 1.5:
|
|
- exchangeableK.append('交换性钾:超阈值。')
|
|
|
|
|
|
+ exchangeableK.append('交换性钾:复核数据合理性。')
|
|
exchangeableKTar.append('交换性钾。')
|
|
exchangeableKTar.append('交换性钾。')
|
|
else:
|
|
else:
|
|
exchangeableK.append('')
|
|
exchangeableK.append('')
|
|
exchangeableKTar.append('')
|
|
exchangeableKTar.append('')
|
|
# (7)交换性钠在[0.1, 2]范围之外的,存疑;
|
|
# (7)交换性钠在[0.1, 2]范围之外的,存疑;
|
|
if row['交换性钠cmol(+)/kg'] < 0.1 or row['交换性钠cmol(+)/kg'] > 2:
|
|
if row['交换性钠cmol(+)/kg'] < 0.1 or row['交换性钠cmol(+)/kg'] > 2:
|
|
- exchangeableNa.append('交换性钠:超阈值。')
|
|
|
|
|
|
+ exchangeableNa.append('交换性钠:复核数据合理性。')
|
|
exchangeableNaTar.append('交换性钠。')
|
|
exchangeableNaTar.append('交换性钠。')
|
|
else:
|
|
else:
|
|
exchangeableNa.append('')
|
|
exchangeableNa.append('')
|
|
@@ -457,70 +457,70 @@ def eight_ion_coun(arr, summary):
|
|
#(2)水溶性盐总量在[0.1, 2]范围之外的,存疑;
|
|
#(2)水溶性盐总量在[0.1, 2]范围之外的,存疑;
|
|
for index, row in arr.iterrows():
|
|
for index, row in arr.iterrows():
|
|
if (not pd.isna(row['水溶性全盐量g/kg']) and row['水溶性全盐量g/kg'] < 0.1) or (not pd.isna(row['水溶性全盐量g/kg']) and row['水溶性全盐量g/kg'] > 2):
|
|
if (not pd.isna(row['水溶性全盐量g/kg']) and row['水溶性全盐量g/kg'] < 0.1) or (not pd.isna(row['水溶性全盐量g/kg']) and row['水溶性全盐量g/kg'] > 2):
|
|
- allArr.append('全盐量:超阈值。')
|
|
|
|
|
|
+ allArr.append('全盐量:复核数据合理性。')
|
|
allArrTar.append('全盐量。')
|
|
allArrTar.append('全盐量。')
|
|
else:
|
|
else:
|
|
allArr.append('')
|
|
allArr.append('')
|
|
allArrTar.append('')
|
|
allArrTar.append('')
|
|
#(3)电导率在[0.01, 2]范围之外的,存疑;
|
|
#(3)电导率在[0.01, 2]范围之外的,存疑;
|
|
if ( not pd.isna(row['电导率ms/cm']) and row['电导率ms/cm'] < 0.01) or (not pd.isna(row['电导率ms/cm']) and row['电导率ms/cm'] > 2):
|
|
if ( not pd.isna(row['电导率ms/cm']) and row['电导率ms/cm'] < 0.01) or (not pd.isna(row['电导率ms/cm']) and row['电导率ms/cm'] > 2):
|
|
- conductivity.append('电导率:超阈值。')
|
|
|
|
|
|
+ conductivity.append('电导率:复核数据合理性。')
|
|
conductivityTar.append('电导率。')
|
|
conductivityTar.append('电导率。')
|
|
else:
|
|
else:
|
|
conductivity.append('')
|
|
conductivity.append('')
|
|
conductivityTar.append('')
|
|
conductivityTar.append('')
|
|
#(4)水溶性钠在[0.05, 0.5]范围之外的,存疑;
|
|
#(4)水溶性钠在[0.05, 0.5]范围之外的,存疑;
|
|
if (not pd.isna(row['水溶性钠离子含量Cmol(Na+)/kg']) and row['水溶性钠离子含量Cmol(Na+)/kg'] <0.05) or (pd.isna(row['水溶性钠离子含量Cmol(Na+)/kg']) and row['水溶性钠离子含量Cmol(Na+)/kg'] > 0.5):
|
|
if (not pd.isna(row['水溶性钠离子含量Cmol(Na+)/kg']) and row['水溶性钠离子含量Cmol(Na+)/kg'] <0.05) or (pd.isna(row['水溶性钠离子含量Cmol(Na+)/kg']) and row['水溶性钠离子含量Cmol(Na+)/kg'] > 0.5):
|
|
- naArr.append('水溶性钠离子:水溶性钠离子超阈值。')
|
|
|
|
|
|
+ naArr.append('水溶性钠离子:水溶性钠离子复核数据合理性。')
|
|
naArrTar.append('水溶性钠离子。')
|
|
naArrTar.append('水溶性钠离子。')
|
|
else:
|
|
else:
|
|
naArr.append('')
|
|
naArr.append('')
|
|
naArrTar.append('')
|
|
naArrTar.append('')
|
|
#(5)水溶性钾在[0.01, 0.5]范围之外的,存疑;
|
|
#(5)水溶性钾在[0.01, 0.5]范围之外的,存疑;
|
|
if (not pd.isna(row['水溶性钾离子含量Cmol(K+)/kg']) and row['水溶性钾离子含量Cmol(K+)/kg'] <0.01) or ( not pd.isna(row['水溶性钾离子含量Cmol(K+)/kg']) and row['水溶性钾离子含量Cmol(K+)/kg'] > 0.5):
|
|
if (not pd.isna(row['水溶性钾离子含量Cmol(K+)/kg']) and row['水溶性钾离子含量Cmol(K+)/kg'] <0.01) or ( not pd.isna(row['水溶性钾离子含量Cmol(K+)/kg']) and row['水溶性钾离子含量Cmol(K+)/kg'] > 0.5):
|
|
- kArr.append('水溶性钾离子:超阈值。')
|
|
|
|
|
|
+ kArr.append('水溶性钾离子:复核数据合理性。')
|
|
kArrTar.append('水溶性钾离子。')
|
|
kArrTar.append('水溶性钾离子。')
|
|
else:
|
|
else:
|
|
kArr.append('')
|
|
kArr.append('')
|
|
kArrTar.append('')
|
|
kArrTar.append('')
|
|
#(6)水溶性钙在[0.25, 5]范围之外的,存疑;
|
|
#(6)水溶性钙在[0.25, 5]范围之外的,存疑;
|
|
if (not pd.isna(row['水溶性钙离子含量cmol(1/2Ca2+)/kg']) and row['水溶性钙离子含量cmol(1/2Ca2+)/kg'] <0.25) or (not pd.isna(row['水溶性钙离子含量cmol(1/2Ca2+)/kg']) and row['水溶性钙离子含量cmol(1/2Ca2+)/kg'] > 0.5):
|
|
if (not pd.isna(row['水溶性钙离子含量cmol(1/2Ca2+)/kg']) and row['水溶性钙离子含量cmol(1/2Ca2+)/kg'] <0.25) or (not pd.isna(row['水溶性钙离子含量cmol(1/2Ca2+)/kg']) and row['水溶性钙离子含量cmol(1/2Ca2+)/kg'] > 0.5):
|
|
- caArr.append('水溶性钙离子:超阈值。')
|
|
|
|
|
|
+ caArr.append('水溶性钙离子:复核数据合理性。')
|
|
caArrTar.append('水溶性钙离子。')
|
|
caArrTar.append('水溶性钙离子。')
|
|
else:
|
|
else:
|
|
caArr.append('')
|
|
caArr.append('')
|
|
caArrTar.append('')
|
|
caArrTar.append('')
|
|
#(7)水溶性镁在[0.125, 2.5]范围之外的,存疑;
|
|
#(7)水溶性镁在[0.125, 2.5]范围之外的,存疑;
|
|
if (not pd.isna(row['水溶性镁离子Cmol(1/2Mg2+)/kg']) and row['水溶性镁离子Cmol(1/2Mg2+)/kg'] <0.125) or (not pd.isna(row['水溶性镁离子Cmol(1/2Mg2+)/kg']) and row['水溶性镁离子Cmol(1/2Mg2+)/kg'] > 2.5):
|
|
if (not pd.isna(row['水溶性镁离子Cmol(1/2Mg2+)/kg']) and row['水溶性镁离子Cmol(1/2Mg2+)/kg'] <0.125) or (not pd.isna(row['水溶性镁离子Cmol(1/2Mg2+)/kg']) and row['水溶性镁离子Cmol(1/2Mg2+)/kg'] > 2.5):
|
|
- mgArr.append('水溶性镁离子:超阈值。')
|
|
|
|
|
|
+ mgArr.append('水溶性镁离子:复核数据合理性。')
|
|
mgArrTar.append('水溶性镁离子。')
|
|
mgArrTar.append('水溶性镁离子。')
|
|
else:
|
|
else:
|
|
mgArr.append('')
|
|
mgArr.append('')
|
|
mgArrTar.append('')
|
|
mgArrTar.append('')
|
|
#(8)水溶性碳酸根在[0.01, 2.5]范围之外的,存疑;
|
|
#(8)水溶性碳酸根在[0.01, 2.5]范围之外的,存疑;
|
|
if (not pd.isna(row['水溶性碳酸根离子含量cmol(1/2CO32+)/kg']) and row['水溶性碳酸根离子含量cmol(1/2CO32+)/kg'] <0.01) or (not pd.isna(row['水溶性碳酸根离子含量cmol(1/2CO32+)/kg']) and row['水溶性碳酸根离子含量cmol(1/2CO32+)/kg'] > 2.5):
|
|
if (not pd.isna(row['水溶性碳酸根离子含量cmol(1/2CO32+)/kg']) and row['水溶性碳酸根离子含量cmol(1/2CO32+)/kg'] <0.01) or (not pd.isna(row['水溶性碳酸根离子含量cmol(1/2CO32+)/kg']) and row['水溶性碳酸根离子含量cmol(1/2CO32+)/kg'] > 2.5):
|
|
- coArr.append('水溶性碳酸根:超阈值。')
|
|
|
|
|
|
+ coArr.append('水溶性碳酸根:复核数据合理性。')
|
|
coArrTar.append('水溶性碳酸根。')
|
|
coArrTar.append('水溶性碳酸根。')
|
|
else:
|
|
else:
|
|
coArr.append('')
|
|
coArr.append('')
|
|
coArrTar.append('')
|
|
coArrTar.append('')
|
|
#(9)水溶性碳酸氢根在[0.05, 5]范围之外的,存疑;
|
|
#(9)水溶性碳酸氢根在[0.05, 5]范围之外的,存疑;
|
|
if (not pd.isna(row['水溶性碳酸氢离子含量cmol(1/2HCO3-)/kg']) and row['水溶性碳酸氢离子含量cmol(1/2HCO3-)/kg'] <0.05) or (not pd.isna(row['水溶性碳酸氢离子含量cmol(1/2HCO3-)/kg']) and row['水溶性碳酸氢离子含量cmol(1/2HCO3-)/kg'] > 5):
|
|
if (not pd.isna(row['水溶性碳酸氢离子含量cmol(1/2HCO3-)/kg']) and row['水溶性碳酸氢离子含量cmol(1/2HCO3-)/kg'] <0.05) or (not pd.isna(row['水溶性碳酸氢离子含量cmol(1/2HCO3-)/kg']) and row['水溶性碳酸氢离子含量cmol(1/2HCO3-)/kg'] > 5):
|
|
- cohArr.append('水溶性碳酸氢根:超阈值。')
|
|
|
|
|
|
+ cohArr.append('水溶性碳酸氢根:复核数据合理性。')
|
|
cohArrTar.append('水溶性碳酸氢根。')
|
|
cohArrTar.append('水溶性碳酸氢根。')
|
|
else:
|
|
else:
|
|
cohArr.append('')
|
|
cohArr.append('')
|
|
cohArrTar.append('')
|
|
cohArrTar.append('')
|
|
#(10)水溶性硫酸根在[0.25, 2.5]范围之外的,存疑;
|
|
#(10)水溶性硫酸根在[0.25, 2.5]范围之外的,存疑;
|
|
if (not pd.isna(row['水溶性硫酸根离子含量cmol(1/2SO42-)/kg']) and row['水溶性硫酸根离子含量cmol(1/2SO42-)/kg'] <0.25) or (not pd.isna(row['水溶性硫酸根离子含量cmol(1/2SO42-)/kg']) and row['水溶性硫酸根离子含量cmol(1/2SO42-)/kg'] > 2.5):
|
|
if (not pd.isna(row['水溶性硫酸根离子含量cmol(1/2SO42-)/kg']) and row['水溶性硫酸根离子含量cmol(1/2SO42-)/kg'] <0.25) or (not pd.isna(row['水溶性硫酸根离子含量cmol(1/2SO42-)/kg']) and row['水溶性硫酸根离子含量cmol(1/2SO42-)/kg'] > 2.5):
|
|
- soArr.append('水溶性硫酸根:超阈值。')
|
|
|
|
|
|
+ soArr.append('水溶性硫酸根:复核数据合理性。')
|
|
soArrTar.append('水溶性硫酸根。')
|
|
soArrTar.append('水溶性硫酸根。')
|
|
else:
|
|
else:
|
|
soArr.append('')
|
|
soArr.append('')
|
|
soArrTar.append('')
|
|
soArrTar.append('')
|
|
#(11)水溶性氯根在[0.5, 5]范围之外的,存疑;
|
|
#(11)水溶性氯根在[0.5, 5]范围之外的,存疑;
|
|
if (not pd.isna(row['水溶性氯离子含量cmol(Cl-)/kg']) and row['水溶性氯离子含量cmol(Cl-)/kg'] <0.5) or (not pd.isna(row['水溶性氯离子含量cmol(Cl-)/kg']) and row['水溶性氯离子含量cmol(Cl-)/kg'] > 5):
|
|
if (not pd.isna(row['水溶性氯离子含量cmol(Cl-)/kg']) and row['水溶性氯离子含量cmol(Cl-)/kg'] <0.5) or (not pd.isna(row['水溶性氯离子含量cmol(Cl-)/kg']) and row['水溶性氯离子含量cmol(Cl-)/kg'] > 5):
|
|
- clArr.append('水溶性氯根:超阈值。')
|
|
|
|
|
|
+ clArr.append('水溶性氯根:复核数据合理性。')
|
|
clArrTar.append('水溶性氯根。')
|
|
clArrTar.append('水溶性氯根。')
|
|
else:
|
|
else:
|
|
clArr.append('')
|
|
clArr.append('')
|
|
@@ -559,12 +559,12 @@ def eight_ion_coun(arr, summary):
|
|
changeComArr.append('')
|
|
changeComArr.append('')
|
|
#(16)(水溶性全盐量 - 八大离子加和) / 八大离子加和 * 100,不超过±20 %
|
|
#(16)(水溶性全盐量 - 八大离子加和) / 八大离子加和 * 100,不超过±20 %
|
|
if not pd.isna(row['(水溶性全盐量-八大离子加和)/水溶性全盐量×100']) and (row['(水溶性全盐量-八大离子加和)/水溶性全盐量×100'] < -0.2 or row['(水溶性全盐量-八大离子加和)/水溶性全盐量×100'] > 0.2) :
|
|
if not pd.isna(row['(水溶性全盐量-八大离子加和)/水溶性全盐量×100']) and (row['(水溶性全盐量-八大离子加和)/水溶性全盐量×100'] < -0.2 or row['(水溶性全盐量-八大离子加和)/水溶性全盐量×100'] > 0.2) :
|
|
- rateArr.append('存疑:(水溶性全盐量-八大离子加和)/水溶性全盐量×100超阈值。')
|
|
|
|
|
|
+ rateArr.append('存疑:(水溶性全盐量-八大离子加和)/水溶性全盐量×100复核数据合理性。')
|
|
else:
|
|
else:
|
|
rateArr.append('')
|
|
rateArr.append('')
|
|
#(17)阳离子总量 - 阴离子总量应基本相等,超过±1则提示异常
|
|
#(17)阳离子总量 - 阴离子总量应基本相等,超过±1则提示异常
|
|
if not pd.isna(row['阳离子总量-阴离子总量']) and (row['阳离子总量-阴离子总量'] < -1 or row['阳离子总量-阴离子总量'] > 1) :
|
|
if not pd.isna(row['阳离子总量-阴离子总量']) and (row['阳离子总量-阴离子总量'] < -1 or row['阳离子总量-阴离子总量'] > 1) :
|
|
- subtractionArr.append('存疑:阳离子总量 - 阴离子总量超阈值。')
|
|
|
|
|
|
+ subtractionArr.append('存疑:阳离子总量 - 阴离子总量复核数据合理性。')
|
|
else:
|
|
else:
|
|
subtractionArr.append('')
|
|
subtractionArr.append('')
|
|
resData = pd.DataFrame({
|
|
resData = pd.DataFrame({
|
|
@@ -615,71 +615,71 @@ def nutrient_data(arr):
|
|
sKErrTar.append('')
|
|
sKErrTar.append('')
|
|
#(2)有机质在[2, 50]范围之外的,存疑;有机质<5提示异常;
|
|
#(2)有机质在[2, 50]范围之外的,存疑;有机质<5提示异常;
|
|
if row['有机质g/kg'] < 2 or row['有机质g/kg'] >50:
|
|
if row['有机质g/kg'] < 2 or row['有机质g/kg'] >50:
|
|
- organicMatter.append('有机质:超阈值。')
|
|
|
|
|
|
+ organicMatter.append('有机质:复核数据合理性。')
|
|
organicMatterTar.append('有机质。')
|
|
organicMatterTar.append('有机质。')
|
|
else:
|
|
else:
|
|
organicMatter.append('')
|
|
organicMatter.append('')
|
|
organicMatterTar.append('')
|
|
organicMatterTar.append('')
|
|
#(3)全氮在[0.1, 2.5]范围之外的;存疑;
|
|
#(3)全氮在[0.1, 2.5]范围之外的;存疑;
|
|
if row['全氮g/kg'] < 0.1 or row['全氮g/kg'] > 2.5:
|
|
if row['全氮g/kg'] < 0.1 or row['全氮g/kg'] > 2.5:
|
|
- NArr.append('全氮:超阈值。')
|
|
|
|
|
|
+ NArr.append('全氮:复核数据合理性。')
|
|
NArrTar.append('全氮。')
|
|
NArrTar.append('全氮。')
|
|
else:
|
|
else:
|
|
NArr.append('')
|
|
NArr.append('')
|
|
NArrTar.append('')
|
|
NArrTar.append('')
|
|
#(4)全磷在[0.18, 1.5]范围之外的;存疑;
|
|
#(4)全磷在[0.18, 1.5]范围之外的;存疑;
|
|
if row['全磷g/kg'] < 0.18 or row['全磷g/kg'] > 1.5:
|
|
if row['全磷g/kg'] < 0.18 or row['全磷g/kg'] > 1.5:
|
|
- PArr.append('全磷:超阈值。')
|
|
|
|
|
|
+ PArr.append('全磷:复核数据合理性。')
|
|
PArrTar.append('全磷。')
|
|
PArrTar.append('全磷。')
|
|
else:
|
|
else:
|
|
PArr.append('')
|
|
PArr.append('')
|
|
PArrTar.append('')
|
|
PArrTar.append('')
|
|
#(5)全钾在[10, 29]范围之外的;存疑;
|
|
#(5)全钾在[10, 29]范围之外的;存疑;
|
|
if row['全钾g/kg'] < 10 or row['全钾g/kg'] > 29:
|
|
if row['全钾g/kg'] < 10 or row['全钾g/kg'] > 29:
|
|
- KArr.append('全钾:超阈值。')
|
|
|
|
|
|
+ KArr.append('全钾:复核数据合理性。')
|
|
KArrTar.append('全钾。')
|
|
KArrTar.append('全钾。')
|
|
else:
|
|
else:
|
|
KArr.append('')
|
|
KArr.append('')
|
|
KArrTar.append('')
|
|
KArrTar.append('')
|
|
#(6)有效磷在[1, 80]范围之外的;存疑; 耕地 超过80存疑
|
|
#(6)有效磷在[1, 80]范围之外的;存疑; 耕地 超过80存疑
|
|
if (row['pH'] >= 6.5 and (row['有效磷g/kg'] < 3 or row['有效磷g/kg'] > 60)) or (row['pH'] < 6.5 and (row['有效磷g/kg'] <1 or row['有效磷g/kg'] > 80) or (row['编号'][6:10] == '0101' or row['编号'][6:10] == '0102' or row['编号'][6:10] == '0103') and row['有效磷g/kg'] > 60) :
|
|
if (row['pH'] >= 6.5 and (row['有效磷g/kg'] < 3 or row['有效磷g/kg'] > 60)) or (row['pH'] < 6.5 and (row['有效磷g/kg'] <1 or row['有效磷g/kg'] > 80) or (row['编号'][6:10] == '0101' or row['编号'][6:10] == '0102' or row['编号'][6:10] == '0103') and row['有效磷g/kg'] > 60) :
|
|
- availableP.append('有效磷:超阈值。')
|
|
|
|
|
|
+ availableP.append('有效磷:复核数据合理性。')
|
|
availablePTar.append('有效磷。')
|
|
availablePTar.append('有效磷。')
|
|
else:
|
|
else:
|
|
availableP.append('')
|
|
availableP.append('')
|
|
availablePTar.append('')
|
|
availablePTar.append('')
|
|
# if row['有效磷g/kg'] < 1 or row['有效磷g/kg'] > 60 or ((row['编号'][6:11] == '0101' or row['编号'][6:11] == '0102' or row['编号'][6:11] == '0103') and row['有效磷g/kg'] > 60):
|
|
# if row['有效磷g/kg'] < 1 or row['有效磷g/kg'] > 60 or ((row['编号'][6:11] == '0101' or row['编号'][6:11] == '0102' or row['编号'][6:11] == '0103') and row['有效磷g/kg'] > 60):
|
|
- # availableP.append('存疑:有效磷超阈值。')
|
|
|
|
|
|
+ # availableP.append('存疑:有效磷复核数据合理性。')
|
|
# else:
|
|
# else:
|
|
# availableP.append('')
|
|
# availableP.append('')
|
|
#(7)速效钾在[30, 300] 范围之外的;存疑; 耕地超过300存疑
|
|
#(7)速效钾在[30, 300] 范围之外的;存疑; 耕地超过300存疑
|
|
if row['速效钾mg/kg'] < 30 or row['速效钾mg/kg'] > 300 or ((row['编号'][6:10] == '0101' or row['编号'][6:10] == '0102' or row['编号'][6:10] == '0103') and row['速效钾mg/kg'] > 300):
|
|
if row['速效钾mg/kg'] < 30 or row['速效钾mg/kg'] > 300 or ((row['编号'][6:10] == '0101' or row['编号'][6:10] == '0102' or row['编号'][6:10] == '0103') and row['速效钾mg/kg'] > 300):
|
|
- availablek.append('速效钾:超阈值。')
|
|
|
|
|
|
+ availablek.append('速效钾:复核数据合理性。')
|
|
availablekTar.append('速效钾。')
|
|
availablekTar.append('速效钾。')
|
|
else:
|
|
else:
|
|
availablek.append('')
|
|
availablek.append('')
|
|
availablekTar.append('')
|
|
availablekTar.append('')
|
|
#(8)缓效钾在[100, 2000]范围之外的;存疑;
|
|
#(8)缓效钾在[100, 2000]范围之外的;存疑;
|
|
if row['缓效钾mg/kg'] < 100 or row['缓效钾mg/kg'] > 2000:
|
|
if row['缓效钾mg/kg'] < 100 or row['缓效钾mg/kg'] > 2000:
|
|
- slowlyK.append('缓效钾:超阈值。')
|
|
|
|
|
|
+ slowlyK.append('缓效钾:复核数据合理性。')
|
|
slowlyKTar.append('缓效钾。')
|
|
slowlyKTar.append('缓效钾。')
|
|
else:
|
|
else:
|
|
slowlyK.append('')
|
|
slowlyK.append('')
|
|
slowlyKTar.append('')
|
|
slowlyKTar.append('')
|
|
#(9)有机质 / 全氮比值≥20和≤13,提示存疑
|
|
#(9)有机质 / 全氮比值≥20和≤13,提示存疑
|
|
if row['有机质g/kg']/row['全氮g/kg'] >=20 or row['有机质g/kg']/row['全氮g/kg'] <=13 :
|
|
if row['有机质g/kg']/row['全氮g/kg'] >=20 or row['有机质g/kg']/row['全氮g/kg'] <=13 :
|
|
- organicRate.append('存疑:有机质/全氮比值超阈值。')
|
|
|
|
|
|
+ organicRate.append('存疑:有机质/全氮比值复核数据合理性。')
|
|
else:
|
|
else:
|
|
organicRate.append('')
|
|
organicRate.append('')
|
|
#(10)有机质、全氮含量异常高,但速效养分特低,提示异常 无法量化不处理
|
|
#(10)有机质、全氮含量异常高,但速效养分特低,提示异常 无法量化不处理
|
|
#(11)母岩为片麻岩,但全钾、速效缓效钾含量低,提示异常 无法量化不处理
|
|
#(11)母岩为片麻岩,但全钾、速效缓效钾含量低,提示异常 无法量化不处理
|
|
#(12)有效磷<3和大于60,提示异常;速效钾<50提示异常
|
|
#(12)有效磷<3和大于60,提示异常;速效钾<50提示异常
|
|
if row['有效磷g/kg'] < 3 or row['有效磷g/kg'] > 60:
|
|
if row['有效磷g/kg'] < 3 or row['有效磷g/kg'] > 60:
|
|
- availablePCom.append('有效磷:超阈值。')
|
|
|
|
|
|
+ availablePCom.append('有效磷:复核数据合理性。')
|
|
else:
|
|
else:
|
|
availablePCom.append('')
|
|
availablePCom.append('')
|
|
if row['速效钾mg/kg'] < 50:
|
|
if row['速效钾mg/kg'] < 50:
|
|
- availableTxt.append('速效钾:超阈值。')
|
|
|
|
|
|
+ availableTxt.append('速效钾:复核数据合理性。')
|
|
else:
|
|
else:
|
|
availableTxt.append('')
|
|
availableTxt.append('')
|
|
#(13)速效钾>缓效钾,提示异常
|
|
#(13)速效钾>缓效钾,提示异常
|
|
@@ -722,35 +722,35 @@ def soil_metal(arr):
|
|
for index, row in arr.iterrows():
|
|
for index, row in arr.iterrows():
|
|
#(1)有效硫在[2, 60]范围之外的,存疑;
|
|
#(1)有效硫在[2, 60]范围之外的,存疑;
|
|
if (not pd.isna(row['有效硫mg/kg']) and row['有效硫mg/kg'] <2) or (not pd.isna(row['有效硫mg/kg']) and row['有效硫mg/kg'] >60):
|
|
if (not pd.isna(row['有效硫mg/kg']) and row['有效硫mg/kg'] <2) or (not pd.isna(row['有效硫mg/kg']) and row['有效硫mg/kg'] >60):
|
|
- effectiveL.append('有效硫:超阈值。')
|
|
|
|
|
|
+ effectiveL.append('有效硫:复核数据合理性。')
|
|
effectiveLTar.append('有效硫。')
|
|
effectiveLTar.append('有效硫。')
|
|
else:
|
|
else:
|
|
effectiveL.append('')
|
|
effectiveL.append('')
|
|
effectiveLTar.append('')
|
|
effectiveLTar.append('')
|
|
#(2)有效硅在[10, 500]范围之外的,存疑;
|
|
#(2)有效硅在[10, 500]范围之外的,存疑;
|
|
if ( not pd.isna(row['有效硅mg/kg']) and row['有效硅mg/kg'] <10) or (not pd.isna(row['有效硅mg/kg']) and row['有效硅mg/kg'] >500):
|
|
if ( not pd.isna(row['有效硅mg/kg']) and row['有效硅mg/kg'] <10) or (not pd.isna(row['有效硅mg/kg']) and row['有效硅mg/kg'] >500):
|
|
- effectiveG.append('有效硅:超阈值。')
|
|
|
|
|
|
+ effectiveG.append('有效硅:复核数据合理性。')
|
|
effectiveGTar.append('有效硅。')
|
|
effectiveGTar.append('有效硅。')
|
|
else:
|
|
else:
|
|
effectiveG.append('')
|
|
effectiveG.append('')
|
|
effectiveGTar.append('')
|
|
effectiveGTar.append('')
|
|
#(3)有效铁在[5, 300]范围之外的,存疑;
|
|
#(3)有效铁在[5, 300]范围之外的,存疑;
|
|
if ( not pd.isna(row['有效铁mg/kg']) and row['有效铁mg/kg'] <5) or (not pd.isna(row['有效铁mg/kg']) and row['有效铁mg/kg'] >300):
|
|
if ( not pd.isna(row['有效铁mg/kg']) and row['有效铁mg/kg'] <5) or (not pd.isna(row['有效铁mg/kg']) and row['有效铁mg/kg'] >300):
|
|
- effectiveT.append('有效铁:超阈值。')
|
|
|
|
|
|
+ effectiveT.append('有效铁:复核数据合理性。')
|
|
effectiveTTar.append('有效铁。')
|
|
effectiveTTar.append('有效铁。')
|
|
else:
|
|
else:
|
|
effectiveT.append('')
|
|
effectiveT.append('')
|
|
effectiveTTar.append('')
|
|
effectiveTTar.append('')
|
|
#(4)有效锰在[5, 200]范围之外的,存疑;
|
|
#(4)有效锰在[5, 200]范围之外的,存疑;
|
|
if (not pd.isna(row['有效锰mg/kg']) and row['有效锰mg/kg'] <5) or (not pd.isna(row['有效锰mg/kg']) and row['有效锰mg/kg'] >200) :
|
|
if (not pd.isna(row['有效锰mg/kg']) and row['有效锰mg/kg'] <5) or (not pd.isna(row['有效锰mg/kg']) and row['有效锰mg/kg'] >200) :
|
|
- effectiveM.append('有效锰:超阈值。')
|
|
|
|
|
|
+ effectiveM.append('有效锰:复核数据合理性。')
|
|
effectiveMTar.append('有效锰。')
|
|
effectiveMTar.append('有效锰。')
|
|
else:
|
|
else:
|
|
effectiveM.append('')
|
|
effectiveM.append('')
|
|
effectiveMTar.append('')
|
|
effectiveMTar.append('')
|
|
#(5)有效铜在[0.1, 8]范围之外的,存疑;
|
|
#(5)有效铜在[0.1, 8]范围之外的,存疑;
|
|
if ( not pd.isna(row['有效铜mg/kg']) and row['有效铜mg/kg'] <0.1) or (not pd.isna(row['有效铜mg/kg']) and row['有效铜mg/kg'] >8):
|
|
if ( not pd.isna(row['有效铜mg/kg']) and row['有效铜mg/kg'] <0.1) or (not pd.isna(row['有效铜mg/kg']) and row['有效铜mg/kg'] >8):
|
|
- effectiveCu.append('有效铜:超阈值。')
|
|
|
|
|
|
+ effectiveCu.append('有效铜:复核数据合理性。')
|
|
effectiveCuTar.append('有效铜。')
|
|
effectiveCuTar.append('有效铜。')
|
|
else:
|
|
else:
|
|
effectiveCu.append('')
|
|
effectiveCu.append('')
|
|
@@ -758,21 +758,21 @@ def soil_metal(arr):
|
|
|
|
|
|
#(6)有效锌在[0.1, 10] 范围之外的,存疑;
|
|
#(6)有效锌在[0.1, 10] 范围之外的,存疑;
|
|
if (not pd.isna(row['有效锌mg/kg']) and row['有效锌mg/kg'] <0.1) or (not pd.isna(row['有效锌mg/kg']) and row['有效锌mg/kg'] >10):
|
|
if (not pd.isna(row['有效锌mg/kg']) and row['有效锌mg/kg'] <0.1) or (not pd.isna(row['有效锌mg/kg']) and row['有效锌mg/kg'] >10):
|
|
- effectiveX.append('有效锌:超阈值。')
|
|
|
|
|
|
+ effectiveX.append('有效锌:复核数据合理性。')
|
|
effectiveXTar.append('有效锌。')
|
|
effectiveXTar.append('有效锌。')
|
|
else:
|
|
else:
|
|
effectiveX.append('')
|
|
effectiveX.append('')
|
|
effectiveXTar.append('')
|
|
effectiveXTar.append('')
|
|
#(7)有效硼在[0.1, 2] 范围之外的,存疑;
|
|
#(7)有效硼在[0.1, 2] 范围之外的,存疑;
|
|
if (not pd.isna(row['有效硼mg/kg']) and row['有效硼mg/kg'] <0.1) or (not pd.isna(row['有效硼mg/kg']) and row['有效硼mg/kg'] >2):
|
|
if (not pd.isna(row['有效硼mg/kg']) and row['有效硼mg/kg'] <0.1) or (not pd.isna(row['有效硼mg/kg']) and row['有效硼mg/kg'] >2):
|
|
- effectiveP.append('有效硼:超阈值。')
|
|
|
|
|
|
+ effectiveP.append('有效硼:复核数据合理性。')
|
|
effectivePTar.append('有效硼。')
|
|
effectivePTar.append('有效硼。')
|
|
else:
|
|
else:
|
|
effectiveP.append('')
|
|
effectiveP.append('')
|
|
effectivePTar.append('')
|
|
effectivePTar.append('')
|
|
#(8)有效钼在[0.03, 1]范围之外的,存疑。
|
|
#(8)有效钼在[0.03, 1]范围之外的,存疑。
|
|
if (not pd.isna(row['有效钼mg/kg']) and row['有效钼mg/kg'] <0.03) or (not pd.isna(row['有效钼mg/kg']) and row['有效钼mg/kg'] >1):
|
|
if (not pd.isna(row['有效钼mg/kg']) and row['有效钼mg/kg'] <0.03) or (not pd.isna(row['有效钼mg/kg']) and row['有效钼mg/kg'] >1):
|
|
- effectiveMu.append('有效钼:超阈值。')
|
|
|
|
|
|
+ effectiveMu.append('有效钼:复核数据合理性。')
|
|
effectiveMutar.append('有效钼。')
|
|
effectiveMutar.append('有效钼。')
|
|
else:
|
|
else:
|
|
effectiveMu.append('')
|
|
effectiveMu.append('')
|
|
@@ -927,42 +927,42 @@ def last_metal(arr):
|
|
for index, row in arr.iterrows():
|
|
for index, row in arr.iterrows():
|
|
# (3)总镉在[0.03, 0.3]范围之外的,存疑
|
|
# (3)总镉在[0.03, 0.3]范围之外的,存疑
|
|
if row['镉mg/kg'] < 0.03 or row['镉mg/kg'] > 0.3:
|
|
if row['镉mg/kg'] < 0.03 or row['镉mg/kg'] > 0.3:
|
|
- totalGe.append('总镉:超阈值。')
|
|
|
|
|
|
+ totalGe.append('总镉:复核数据合理性。')
|
|
totalGeTar.append('总镉。')
|
|
totalGeTar.append('总镉。')
|
|
else:
|
|
else:
|
|
totalGe.append('')
|
|
totalGe.append('')
|
|
totalGeTar.append('')
|
|
totalGeTar.append('')
|
|
# (4)总汞在[0.01, 0.3]范围之外的,存疑
|
|
# (4)总汞在[0.01, 0.3]范围之外的,存疑
|
|
if row['汞mg/kg'] < 0.01 or row['汞mg/kg'] > 0.3:
|
|
if row['汞mg/kg'] < 0.01 or row['汞mg/kg'] > 0.3:
|
|
- totalGo.append('总汞:超阈值。')
|
|
|
|
|
|
+ totalGo.append('总汞:复核数据合理性。')
|
|
totalGoTar.append('总汞。')
|
|
totalGoTar.append('总汞。')
|
|
else:
|
|
else:
|
|
totalGo.append('')
|
|
totalGo.append('')
|
|
totalGoTar.append('')
|
|
totalGoTar.append('')
|
|
# (5)总砷在[0.5, 30]范围之外的,存疑
|
|
# (5)总砷在[0.5, 30]范围之外的,存疑
|
|
if row['砷mg/kg'] < 0.5 or row['砷mg/kg'] > 30:
|
|
if row['砷mg/kg'] < 0.5 or row['砷mg/kg'] > 30:
|
|
- totalShen.append('总砷:超阈值。')
|
|
|
|
|
|
+ totalShen.append('总砷:复核数据合理性。')
|
|
totalShenTar.append('总砷。')
|
|
totalShenTar.append('总砷。')
|
|
else:
|
|
else:
|
|
totalShen.append('')
|
|
totalShen.append('')
|
|
totalShenTar.append('')
|
|
totalShenTar.append('')
|
|
# (6)总铅在[2, 100]范围之外的,存疑
|
|
# (6)总铅在[2, 100]范围之外的,存疑
|
|
if row['铅mg/kg'] < 2 or row['铅mg/kg'] > 100:
|
|
if row['铅mg/kg'] < 2 or row['铅mg/kg'] > 100:
|
|
- totalPb.append('总铅:超阈值。')
|
|
|
|
|
|
+ totalPb.append('总铅:复核数据合理性。')
|
|
totalPbTar.append('总铅。')
|
|
totalPbTar.append('总铅。')
|
|
else:
|
|
else:
|
|
totalPb.append('')
|
|
totalPb.append('')
|
|
totalPbTar.append('')
|
|
totalPbTar.append('')
|
|
# (7)总铬在[0.4, 200]范围之外的,存疑
|
|
# (7)总铬在[0.4, 200]范围之外的,存疑
|
|
if row['铬mg/kg'] < 0.4 or row['铬mg/kg'] > 200:
|
|
if row['铬mg/kg'] < 0.4 or row['铬mg/kg'] > 200:
|
|
- totalG.append('总铬:超阈值。')
|
|
|
|
|
|
+ totalG.append('总铬:复核数据合理性。')
|
|
totalGTar.append('总铬。')
|
|
totalGTar.append('总铬。')
|
|
else:
|
|
else:
|
|
totalG.append('')
|
|
totalG.append('')
|
|
totalGTar.append('')
|
|
totalGTar.append('')
|
|
# (8)总镍在[0.3, 100]范围之外的,存疑
|
|
# (8)总镍在[0.3, 100]范围之外的,存疑
|
|
if row['镍mg/kg'] < 0.3 or row['镍mg/kg'] > 100:
|
|
if row['镍mg/kg'] < 0.3 or row['镍mg/kg'] > 100:
|
|
- totalN.append('总镍:超阈值。')
|
|
|
|
|
|
+ totalN.append('总镍:复核数据合理性。')
|
|
totalNTar.append('总镍。')
|
|
totalNTar.append('总镍。')
|
|
else:
|
|
else:
|
|
totalN.append('')
|
|
totalN.append('')
|