-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: inline indexing 1-liners #31625
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
Conversation
…f-indexing-1liners
…f-indexing-1liners
…f-indexing-1liners
…f-indexing-1liners
…f-indexing-1liners
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.
small comment
pandas/core/series.py
Outdated
def _slice(self, slobj: slice, axis: int = 0, kind=None) -> "Series": | ||
slobj = self.index._convert_slice_indexer(slobj, kind=kind or "getitem") | ||
def _slice(self, slobj: slice, axis: int = 0, kind: str = "getitem") -> "Series": | ||
# kind is either "getitem" or "iloc" |
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.
assert?
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.
updated with assertion
also needs rebase |
…f-indexing-1liners
rebased+green |
thanks |
The only 2-liners here are _convert_scalar_indexer and _convert_slice_indexer, which are effectively
axis = min(axis, self.ndim-1)
, but that is unnecessary since all places where these are called have axis < self.ndim.