You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [1]: importxarrayasxrIn [2]: ds=xr.open_dataset('test.nc')
In [3]: ds.sel(time=ds.time[0]) #worksIn [4]: ds.sel(time=ds.time[1], method='nearest') #worksIn [5]: ds.sel(time=ds.time[1]) #does not work
I found the discrepancy between ds['time'][1] and ds.get_index('time')[1]
In [13]: ds.get_index('time')[1]
Out[13]: Timestamp('2018-02-12 06:59:59.999986560')
In [14]: ds['time'][1].valuesOut[14]: numpy.datetime64('2018-02-12T06:59:59.999986000')
Code Sample, a copy-pastable example if possible
Problem description
xarray sometimes fails to slice using its own coordinate values. It looks like it may have to do with precision. Traceback below, test file attached.
Expected Output
Output of
xr.show_versions()
test.zip
The text was updated successfully, but these errors were encountered: