-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
PERF: pass through to numpy validation for iloc setitem #32257
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
PERF: pass through to numpy validation for iloc setitem #32257
Conversation
…ks-_get_setitem_indexer
…ks-_get_setitem_indexer
…ks-_get_setitem_indexer
…ks-_get_setitem_indexer
…ks-_get_setitem_indexer
…ks-_get_setitem_indexer
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.
lgtm. minor nit
pandas/core/indexing.py
Outdated
if isinstance(key, tuple): | ||
if len(key) > self.ndim: | ||
# TODO: we could let this fall through if we are OK | ||
# with having numpy raise IndexError("too many indices for array") |
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.
would be ok i think
@@ -27,6 +27,9 @@ | |||
|
|||
from pandas.tseries.offsets import BDay | |||
|
|||
# We pass through a TypeError raised by numpy |
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.
nit. you used iloc_msg in the other function (non-private); i would make these more verbose
slice_exception_msg
Removed the tuple length validation, picked up on the order of a microsecond compared to the posts from the OP. |
thanks |
We lose a little bit of ground on the range and slice (not really sure why), pick up a bigger amount of ground on list or ndarray.