When trying to convert the “Date” field of a pandas DataFrame using pd.to_datetime(), I get an “OutOfBoundsDatetime” error only when the date is before Year 1700 (otherwise the conversion works fine). Any help?
df = pd.read_excel('Timeline_SecondMillenialH2.xlsx')
df['Date'] = pd.to_datetime(df['Date'], format='%Y-%m-%d')
First 2 records of the Excel file for reference:
Error:
OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1516-01-01 00:00:00