zhuxi 2 anni fa
parent
commit
7a0f080129
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      LIB/MIDDLE/ThermoRunaway/V1_0_2/Trunaway.py

+ 3 - 2
LIB/MIDDLE/ThermoRunaway/V1_0_2/Trunaway.py

@@ -234,8 +234,9 @@ def res_output(TestOrg,scaler,model,group,end_time):
                     sn=res.loc[k,'sn']
                     win=res.loc[k,'window_step']
                     index = res[(res["sn"]== sn)&(res["window_step"]== win)].index.tolist()[0]
-                    res=res.drop([index-2,index-1,index])
-            
+                    res=res.drop([index-2,index-1,index],errors='ignore')
+           
+        if len(res)>0:  
             maxsum=list(res['test_loss_sum'].groupby(res['n_split']).max())
             maxmax=list(res['test_loss_max'].groupby(res['n_split']).max())
             res_start=res.drop_duplicates(subset=['n_split'],keep='first',inplace=False)