Skip to content

BUG: non-monotonic DatetimeIndex does not raise KeyError for missing labels #7827

@shoyer

Description

@shoyer
import pandas as pd
index = pd.to_datetime(['2000-01-02', '2000-01-01'])
index.get_loc('1900-01-01')
array([], dtype=int64)

Metadata

Metadata

Assignees

Labels

BugError ReportingIncorrect or improved errors from pandasIndexingRelated to indexing on series/frames, not to indexes themselves

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions