We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
method="nearest"
JaxDataArray
Add support for method="nearest" in JaxDataArray.sel.
JaxDataArray.sel
For example, calling arr.sel(x=0, method="nearest") will select the data at the x nearest to 0.
arr.sel(x=0, method="nearest")
x
0
See https://docs.xarray.dev/en/latest/generated/xarray.DataArray.sel.html
Implementation could look something like this:
def sel_single(self, key, value, method="nearest"): coords = self.coords[key] argmin = np.argmin(np.abs(coords-value)) return self.isel_single(key, argmin)
The text was updated successfully, but these errors were encountered:
yaugenst-flex
No branches or pull requests
Add support for
method="nearest"
inJaxDataArray.sel
.For example, calling
arr.sel(x=0, method="nearest")
will select the data at thex
nearest to0
.See https://docs.xarray.dev/en/latest/generated/xarray.DataArray.sel.html
Implementation could look something like this:
The text was updated successfully, but these errors were encountered: