-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
Open
Labels
BugIndexRelated to the Index class or subclassesRelated to the Index class or subclassesIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves
Description
Pandas version checks
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
>>> ser = pd.Series(range(15), index=pd.date_range(start="2024-01-01", freq="D", periods=15))
>>> ser.loc["1/10/2024":"1/14/2024"] # ok I suppose
2024-01-10 9
2024-01-11 10
2024-01-12 11
2024-01-13 12
2024-01-14 13
Freq: D, dtype: int64
>>> ser.loc["1/10/2024":"14/1/2024"] # huh? ok...
2024-01-10 9
2024-01-11 10
2024-01-12 11
2024-01-13 12
2024-01-14 13
Freq: D, dtype: int64
>>> ser.loc["10/1/2024":"14/1/2024"]
Series([], Freq: D, dtype: int64)
Issue Description
I am not really sure what the expectations are for handling non-ISO strings as an indexer for a DTI. In the examples above it seems acceptable for the /stop/ argument in the slice to have the day first but the /start/ argument does not assume this
Expected Behavior
Not sure - maybe we should just disallow non-ISO string formats?
Installed Versions
'3.0.0.dev0+681.g434fda08cf'
Metadata
Metadata
Assignees
Labels
BugIndexRelated to the Index class or subclassesRelated to the Index class or subclassesIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves