Skip to content

REF: avoid _get_engine_target in _get_nearest_indexer #43238

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

Merged
merged 5 commits into from
Sep 13, 2021

Conversation

jbrockmendel
Copy link
Member

A step towards supporting arbitrary EA-backed Indexes

else:
# error: Unsupported left operand type for - ("ExtensionArray")
diff = self._values[indexer] - target._values # type: ignore[operator]
return abs(diff)
Copy link
Contributor

Choose a reason for hiding this comment

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

should you use np.abs?

Copy link
Member Author

Choose a reason for hiding this comment

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

both end up calling __abs__, which i think is more obvious this way

@jreback jreback added Refactor Internal refactoring of code Indexing Related to indexing on series/frames, not to indexes themselves labels Aug 31, 2021
@jreback jreback added this to the 1.4 milestone Sep 12, 2021
@jreback
Copy link
Contributor

jreback commented Sep 12, 2021

seems ok, can you rebase

@jreback jreback merged commit 6d5f8e5 into pandas-dev:master Sep 13, 2021
@jbrockmendel jbrockmendel deleted the ref-nearest_indexer branch September 13, 2021 14:39
AlexeyGy pushed a commit to AlexeyGy/pandas that referenced this pull request Sep 13, 2021
AlexeyGy pushed a commit to AlexeyGy/pandas that referenced this pull request Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Indexing Related to indexing on series/frames, not to indexes themselves Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants