Open apj-graham opened 1 month ago
Thanks for the report! pandas could not guess the format of the second string so it relied on the dateutil
library for parsing it which does not take the dayfirst
parameter in consideration. It's generally best to provide the format
parameter for when you're using unusual date formats.
I suppose we should at least warn for when dayfirst is provided and the date format wasn't guessed (cc @MarcoGorelli)
Pandas version checks
[ ] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pandas.
[X] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Dates of the format "YYYYDDMM" are not converted correctly by to_datetime() when dayfirst=True. to_datetime() still reads the date characters as the months
Expected Behavior
Python 3.11.7 | packaged by conda-forge | (main, Dec 23 2023, 14:43:09) [GCC 12.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.
Installed Versions