Skip to content
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

DEPR: Index.get_loc with method #42269

Merged
merged 4 commits into from
Jul 1, 2021

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented Jun 27, 2021

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

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

@jbrockmendel jbrockmendel added Deprecate Functionality to remove in pandas Indexing Related to indexing on series/frames, not to indexes themselves labels Jun 30, 2021
@jreback jreback added this to the 1.4 milestone Jul 1, 2021
@jreback jreback merged commit 4dc6785 into pandas-dev:master Jul 1, 2021
@jbrockmendel jbrockmendel deleted the depr-get_loc-method branch July 1, 2021 23:16
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
@shoyer
Copy link
Member

shoyer commented Aug 20, 2021

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
Copy link
Member

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
Copy link
Member Author

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

yes.

@jbrockmendel
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants