Skip to content

Conversation

@raghavendranath
Copy link

@raghavendranath raghavendranath commented Nov 5, 2025

Before:

ser.loc["1/10/2024":"1/14/2024"]      # Returns Jan 10-14
ser.loc["1/10/2024":"14/1/2024"]      # Also returns Jan 10-14
ser.loc["10/1/2024":"14/1/2024"]      # Returns empty

After:

ser.loc["1/10/2024":"1/14/2024"]      # Still returns Jan 10-14 + FutureWarning
ser.loc["2024-01-10":"2024-01-14"]    # Use ISO format instead

There's no way to know if "1/10/2024" is being parsed as MM/DD or DD/MM until you run it. This deprecation pushes users toward ISO format to avoid the confusion.

@raghavendranath raghavendranath changed the title DEPR: Deprecate non-ISO date string formats in DatetimeIndex.loc #58302 DEPR: Deprecate non-ISO date string formats in DatetimeIndex.loc Nov 5, 2025
@raghavendranath raghavendranath force-pushed the depr-datetimeindex-loc-slice-dayfirst branch from 90dd217 to a627889 Compare November 5, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: .loc with DateTimeIndex allows day first string for stop in slice, but not start

1 participant