Skip to content

Conversation

@jbrockmendel
Copy link
Member

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.

@jbrockmendel jbrockmendel added Clean Indexing Related to indexing on series/frames, not to indexes themselves labels Feb 3, 2020
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small comment

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated with assertion

@jreback
Copy link
Contributor

jreback commented Feb 5, 2020

also needs rebase

@jbrockmendel
Copy link
Member Author

rebased+green

@jreback jreback added this to the 1.1 milestone Feb 6, 2020
@jreback jreback merged commit ecc72f4 into pandas-dev:master Feb 6, 2020
@jreback
Copy link
Contributor

jreback commented Feb 6, 2020

thanks

@jbrockmendel jbrockmendel deleted the ref-indexing-1liners branch February 6, 2020 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Clean Indexing Related to indexing on series/frames, not to indexes themselves

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants