Trimming the tracebacks to make it clearer:
In [19]: to_datetime(['2020-01-01', 'foo'], format='%Y-%m-%d') # ISO, shows 'postion 1' --------------------------------------------------------------------------- File ~/tmp/.venv/lib/python3.8/site-packages/pandas/_libs/tslib.pyx:599, in pandas._libs.tslib.array_to_datetime() ValueError: time data "foo" at position 1 doesn't match format specified In [20]: to_datetime(['2020-01-01', 'foo'], format='%Y-%d-%m') # non-ISO, no position --------------------------------------------------------------------------- File ~/tmp/.venv/lib/python3.8/site-packages/pandas/_libs/tslibs/strptime.pyx:150, in pandas._libs.tslibs.strptime.array_strptime() ValueError: time data 'foo' does not match format '%Y-%d-%m' (match) In [21]: to_datetime(['2020-01-01', '9999-01-01'], format='%Y-%m-%d') # ISO, shows 'postion 1' --------------------------------------------------------------------------- File ~/tmp/.venv/lib/python3.8/site-packages/pandas/_libs/tslibs/np_datetime.pyx:212, in pandas._libs.tslibs.np_datetime.check_dts_bounds() OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 9999-01-01 00:00:00 present at position 1 In [22]: to_datetime(['2020-01-01', '9999-01-01'], format='%Y-%d-%m') # non-ISO, no position --------------------------------------------------------------------------- File ~/tmp/.venv/lib/python3.8/site-packages/pandas/_libs/tslibs/np_datetime.pyx:212, in pandas._libs.tslibs.np_datetime.check_dts_bounds() OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 9999-01-01 00:00:00
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4