BUG: pandas read_csv silently switches date parsing scheme in the middle of reading file corrupting data #37895
Labels
Datetime
Datetime data dtype
Duplicate Report
Duplicate issue or pull request
IO CSV
read_csv, to_csv
In pandas 1.1.4
Problem description
I provoked pandas here (initially by mistake) by letting it parse a file with date format day / month / year, with it's default parser month / day / year. To my horror, it parses the ones that give a valid date with the default parser, and automatically uses the alternative parser on the ones that fails. Giving a mix of dates and without any warning.
Expected Output
Pandas should have failed with an error, or a very severe warning when a date failed to parse with the same parser as the other dates. It should not be allowed to use different parsing schemes within the same data file.
pandas : 1.1.4
numpy : 1.19.4
pytz : 2020.4
dateutil : 2.8.1
The text was updated successfully, but these errors were encountered: