BUG: PeriodIndex.get_loc should raise KeyError #34240
Labels
Bug
Error Reporting
Incorrect or improved errors from pandas
Indexing
Related to indexing on series/frames, not to indexes themselves
Period
Period data type
Milestone
Currently PeriodIndex.get_loc raises a ValueError rather than a KeyError.
Compare that with DatetimeIndex
This leads to other issues like
Serie.__getitem__
andSeries.__contains__
:As part of fixing this, we should revert the change to
pandas/core/groupby/grouper.py
in #34049.The text was updated successfully, but these errors were encountered: