BUG: loc-indexing with a CategoricalIndex with non-string categories by topper-123 · Pull Request #29922 · pandas-dev/pandas (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was hit when you have pd.Series([1,2], index=pd.CategoricalIndex(["a", "b"])).loc[1], i.e. wrong indexing type. It's the same error type as in s = pd.Series([1,2], index=["a", "b"]).loc[1].

I've added a test for it.