Browse Source

bug fix: StringIO and pandas version

Steve Nyemba 4 years ago
parent
commit
941578993b
1 changed files with 2 additions and 1 deletions
  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])