-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
Why does CategoricalIndex.get_value call _convert_scalar_indexer? #31683
Comments
In general, indexing on CategoricalIndex with numeric categories is a thorny topic .. See also #15470 and #14865
If
|
Yep, good catch. A hopefully-more-accurate statement is that when i remove the _convert_scalar_indexer call from |
OK, it looks like get_value is called from two places, one of which is inside |
Yikes, the deeper i dig into this, the worse it gets. _AtIndexer does its own validation instead of deferring to the index objects, so raises slightly different exceptions |
Closed by #31724. |
cc @jreback @jorisvandenbossche @TomAugspurger the meat of CategoricalIndex.get_value reads:
The thing is, if we actually track down that _convert_scalar_indexer call, with
kind="getitem"
it always passes through to the base class method, which ends up checking:But AFAICT
CategoricalIndex.is_floating()
is always False, so it looks like the call inget_value
is a no-op, which I expect was not the original intention.Also possibly undesired:
Can anyone confirm if the no-op call and/or different
__getitem__
behavior is intentional?The text was updated successfully, but these errors were encountered: