瀏覽代碼

bug fix: StringIO and pandas version

Steve Nyemba 4 年之前
父節點
當前提交
941578993b
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      smart/top/__init__.py

+ 2 - 1
smart/top/__init__.py

@@ -13,6 +13,7 @@ import datetime
 # from transport import factory
 import sys
 import hashlib
+from io import StringIO
 class Util:
     
     def app(self,stream):
@@ -75,7 +76,7 @@ def read(**args) :
         t = datetime.datetime.now().strftime('%H:%M:%S')
         m = [item for item in m if len(item) != len (m[0])]
         m = "\n".join(m[1:])    
-        df = pd.read_csv(pd.compat.StringIO(m),sep=xchar)
+        df = pd.read_csv(StringIO(m),sep=xchar)
         df['date'] = np.repeat(d,df.shape[0])
         df['time'] = np.repeat(t,df.shape[0])
         df['node'] = np.repeat(os.uname()[1],df.shape[0])