-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: bug in Index._should_fallback_to_positional #51241
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
BUG: bug in Index._should_fallback_to_positional #51241
Conversation
pandas/core/indexes/base.py
Outdated
if isinstance(self.dtype, np.dtype) and self.dtype.kind in ["i", "u", "f"]: | ||
return False | ||
return not self._holds_integer() | ||
return not is_numeric_dtype(self.dtype) or is_bool_dtype(self.dtype) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this impact perf? the is_foo_dtype checks are pretty slow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked into using inferred and it is better, 120 ns now, vs 1000 ns in first version.
Thanks @topper-123 |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Fixes #51053.