8000 WIP BUG: Inconsistent date parsing of to_datetime by arw2019 · Pull Request #35428 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

WIP BUG: Inconsistent date parsing of to_datetime #35428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improved error message
  • Loading branch information
arw2019 committed Jul 27, 2020
commit 56175ea0d4f11f829e83ea4b216b8e931a162779
8 changes: 4 additions & 4 deletions pandas/_libs/tslibs/parsing.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,16 @@ cdef inline object _parse_delimited_date(str date_string, bint dayfirst):
# in C api, thus we call faster C version for 3.6.1 or newer

if dayfirst and not swapped_day_and_month:
warnings.warn(f"Parsing {date_string} MM/DD format.")
warnings.warn(f"Parsing '{date_string}' in MM/DD/YYYY format.")
elif not dayfirst and swapped_day_and_month:
warnings.warn(f"Parsing {date_string} DD/MM format.")
warnings.warn(f"Parsing '{date_string}' in DD/MM/YYYY format.")

return datetime_new(year, month, day, 0, 0, 0, 0, None), reso

if dayfirst and not swapped_day_and_month:
warnings.warn(f"Parsing {date_string} MM/DD format.")
warnings.warn(f"Parsing '{date_string}' in MM/DD/YYYY format.")
elif not dayfirst and swapped_day_and_month:
warnings.warn(f"Parsing {date_string} DD/MM format.")
warnings.warn(f"Parsing '{date_string}' in DD/MM/YYYY format.")

return datetime(year, month, day, 0, 0, 0, 0, None), reso

Expand Down
0