lmstack 3 years ago
parent
commit
385205a9e4
1 changed files with 10 additions and 7 deletions
  1. 10 7
      LIB/BACKEND/DBManager.py

+ 10 - 7
LIB/BACKEND/DBManager.py

@@ -260,14 +260,17 @@ class DBManager():
                 otherTNumList.append(temp)
                 # if (temp > OtherTNum):
                 #     OtherTNum = temp
-            result = Counter(cellUNumList)
-            CellUNum = max(result, key=result.get)
-            
-            result = Counter(cellTNumList)
-            CellTNum = max(result, key=result.get)
+ 
+            if (len(data)>0):
+                result = Counter(cellUNumList)
+                CellUNum = max(result, key=result.get)
+                
+                result = Counter(cellTNumList)
+                CellTNum = max(result, key=result.get)
+
+                result = Counter(otherTNumList)
+                OtherTNum = max(result, key=result.get)
 
-            result = Counter(otherTNumList)
-            OtherTNum = max(result, key=result.get)
                        
             data_blocks = pd.DataFrame()
             for line in data: