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

ERDDAP_Griddap setSubset() has an issue with pandas 2.0.2 index.get_loc() #4

Open
Brandonpellis opened this issue Aug 10, 2023 · 0 comments

Comments

@Brandonpellis
Copy link

Brandonpellis commented Aug 10, 2023

index.get_loc() no longer accepts multiple arguments (index only, not index and method). We modified our lib to use the get_indexer method. http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.get_loc.html

https://pandas.pydata.org/pandas-docs/version/1.5/reference/api/pandas.Index.get_loc.html?highlight=get_loc#pandas.Index.get_loc states,
"Deprecated since version 1.4: Use index.get_indexer([item], method=…) instead."

We changed line 196 in erddap_griddap_dimensions.py function closestIdx() from

idx = self.values.index.get_loc(value, method=method)
to
idx = self.values.index.get_indexer([value], method=method)[0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant