Skip to content

Instantly share code, notes, and snippets.

Created November 12, 2020 06:48
What would you like to do?
import datetime
import time
timestamp = []
for d, t in zip(data['Date'], data['Time']):
ts = datetime.datetime.strptime(d+' '+t, '%m/%d/%Y %H:%M:%S')
except ValueError:
# print('ValueError')
timeStamp = pd.Series(timestamp)
data['Timestamp'] = timeStamp.values
final_data = data.drop(['Date', 'Time'], axis=1)
final_data = final_data[final_data.Timestamp != 'ValueError']
Copy link

"OverflowError: mktime argument out of range" Any way there's a fix?

Copy link

OverflowError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_1584\ in
6 try:
7 ts = datetime.datetime.strptime(d+' '+t, '%m/%d/%Y %H:%M:%S')
----> 8 timestamp.append(time.mktime(ts.timetuple()))
9 except ValueError:
10 # print('ValueError')

OverflowError: mktime argument out of range

Any way there's a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment