import pandas as pd
import datetime
def open_csv(path):
try:
df = pd.read_csv(path)
return df
except FileNotFoundError:
print("ERR: FileNotFoundError", path)
data = open_csv("historical/BNBBTC")
for d in data["Open_time"]:
print(d)
print(type(d))
print(datetime.datetime.fromtimestamp(d).strftime('%Y-%m-%d %H:%M:%S'))
ошибка:
1514764800000
Traceback (most recent call last):
<class 'int'>
File "D:/bot/add_data.py", line 16, in <module>
print(datetime.datetime.fromtimestamp(d).strftime('%Y-%m-%d %H:%M:%S'))
OSError: [Errno 22] Invalid argument
Не могу понять в чем проблема?Если b = int ("1514764800000"), то все работает!