DEPR: Index.get_loc with method by jbrockmendel · Pull Request #42269 · pandas-dev/pandas (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation4 Commits4 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

jbrockmendel

We only use it one place internally; this will allow us to simplify get_loc, which will marginally improve perf.

JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request

Jul 3, 2021

@jbrockmendel @JulianWgs

@shoyer

We can probably work around it, but just as a heads up, this is also used externally in Xarray in a pretty extensively used code path (#5721).

@lukemanley

Is it correct that the tolerance argument will also need to be removed as part of this? I think the tolerence is only relevant to inexact methods. The tolerance argument is not currently marked as deprecated, but maybe its implicit given the relationship?

@jbrockmendel

Is it correct that the tolerance argument will also need to be removed as part of this? I

yes.

@jbrockmendel

trying to enforce this I found that for DatetimeIndex cases the alternative get_indexer([key], ...) doesn't work because get_loc does string parsing that get_indexer doesn't.

I'd be OK with either a) requiring users to do the parsing themselves before calling get_indexer or b) reverting this deprecation.

@huard huard mentioned this pull request

Apr 3, 2023

Labels

Deprecate

Functionality to remove in pandas

Indexing

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