Skip to content

Why am I getting 'Passing method to Float64Index.get_loc is deprecated' error when using the .sel method to extract some data, and how do I solve it? #6625

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

Closed
ghost opened this issue May 21, 2022 · 5 comments

Comments

@ghost
Copy link

ghost commented May 21, 2022

What is your issue?

climateModels['CSIRO-QCCCE-CSIRO-Mk3-6']['RCP 45'][2]['tasmax'].sel(lon = 74, lat= 31, time = '2041-06-16', method='nearest').data[0]

`\anaconda3\lib\site-packages\xarray\core\indexes.py:234: FutureWarning: Passing method to Float64Index.get_loc is deprecated and will raise in a future version. Use index.get_indexer([item], method=...) instead.

I don't know much about how to solve this issue, can anyone help me out please?

@ghost ghost added the needs triage Issue that has not been reviewed by xarray team member label May 21, 2022
@keewis
Copy link
Collaborator

keewis commented May 21, 2022

what version of xarray are you using? If I remember correctly, we fixed this a few versions ago so you should be able to upgrade to resolve this.

@keewis keewis removed the needs triage Issue that has not been reviewed by xarray team member label May 21, 2022
@son-ra
Copy link

son-ra commented Jul 8, 2022

I am also getting the same error message using a .sel , my version of xarray is '0.20.1'. Should this issue be fixed in that version?

@max-sixty
Copy link
Collaborator

I'm not sure on the exact version — but do we see this in the latest release? https://github.com/pydata/xarray/releases/tag/v2022.03.0

@max-sixty
Copy link
Collaborator

I'll close but please open an bug report if we do see it.

@zrxdaly
Copy link

zrxdaly commented Sep 26, 2022

i got the same warning using Va_Dataset.interp(x = section).

lib/python3.9/site-packages/xarray/core/missing.py:562: FutureWarning: Passing method to Float64Index.get_loc is deprecated and will raise in a future version. Use index.get_indexer([item], method=...) instead.

should we do sm about it?

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

4 participants