-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Can't .loc[label] on a CategoricalIndex with labels being integer #17569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
duplicate of #15470 |
why don't you just show this example there (IOW your top section). its the same issue. |
Actually, this is about the TypeError that |
and its the exact same issue |
It's clearly not the same user facing issue, so I suppose you mean "it probably has the same underlying reason/bug for this failure" ? If so, can you give a bit more explanation? The other issue is not necessarily a bug (although if we decide not to be a bug, very confusing behaviour), it is a API design question where we have to ask whether a categorical index with numerical indices is actually a numerical index or not |
I came around this and this seemed related to #9595 but could also be a bug in the above interacting with the CategoricalIndex. Using the same example as #15470 with pandas 0.20.3:
Code Sample
Problem description
s.loc[2]
shouldn't fail and should select the label '2'.Note this happens also with a pd.DataFrame.
The text was updated successfully, but these errors were encountered: