Explorar o código

优化金茂空值报错

qingfeng %!s(int64=2) %!d(string=hai) anos
pai
achega
7de2566249
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      LIB/MIDDLE/CellStateEstimation/BatDiag/main.py

+ 3 - 0
LIB/MIDDLE/CellStateEstimation/BatDiag/main.py

@@ -86,6 +86,9 @@ def diag_cal():
                 df_diag_ram_sn.reset_index(inplace=True,drop=True)
                 df_bms_ram_sn=df_bms_ram[df_bms_ram['sn']==sn]
                 df_bms_ram_sn.reset_index(inplace=True,drop=True)
+                
+                df_bms=df_bms.dropna(axis=0,subset=['总电流[A]','SOH[%]','SOC[%]','总电压[V]']) #去除有空值的行
+                df_bms.reset_index(inplace=True,drop=True)     #重置索引
 
                 batquality=CBMSBatDiag.BatDiag(sn,celltype,df_bms,df_diag_ram_sn,df_bms_ram_sn,df_soh,df_uniform)
                 df_diag_res, df_bms_res=batquality.diag()   #获取电池故障结果和电池评分结果