Skip to content

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

@Brandonpellis

Description

@Brandonpellis

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions