fork download
  1. import pandas as pd
  2. import datetime
  3.  
  4. df=pd.read_csv(r'C:\Users\User\Desktop\iii.csv', header=None, names=['A','B','C'], dtype={'B':str})
  5. print(df)
  6.  
  7.  
  8. bl = len(df.B)
  9. for i in range(0,bl):
  10. x1 = df.B[i]
  11. if x1[8] == "2" and x1[9] == "4":
  12. x1[8].replace('2','0',inplace=True)
  13. x1[9].replace('4','0',inplace=True)
  14. print(df.B[9])
  15. break
  16.  
  17. def convertDateStr(value):
  18. return datetime.datetime.strptime(value, "%Y%m%d%H").strftime("%Y-%m-%d %H:%M:%S.000")
  19.  
  20. df.B = df.B.apply(convertDateStr)
  21.  
  22.  
Runtime error #stdin #stdout #stderr 0.02s 27712KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
ImportError: No module named 'pandas'