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
Slicing a Dataset with a slice object includes the upper bound, which is different from python, numpy etc.
python 2.7.12, xarray 0.9.6. #1492 (comment) may be relevant, a quick search didn't reveal other issues:
The following illustrates the issue:
import numpy as np import xarray as xr time = xr.DataArray(np.arange(50), dims=['time'], coords={'time' : np.arange(50)}) data = xr.DataArray(np.arange(1000), dims=['row'], coords={'row' : np.arange(1000)}) ds = xr.Dataset({"time" : time, "data" : data}) print ds.sel(time=slice(0,10), row=slice(0,100)) print ds.sel(time=slice(0,10-1), row=slice(0,100-1))
produces
<xarray.Dataset> Dimensions: (row: 101, time: 11) Coordinates: * row (row) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ... * time (time) int64 0 1 2 3 4 5 6 7 8 9 10 Data variables: data (row) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ... <xarray.Dataset> Dimensions: (row: 100, time: 10) Coordinates: * row (row) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ... * time (time) int64 0 1 2 3 4 5 6 7 8 9 Data variables: data (row) int64 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ...
The text was updated successfully, but these errors were encountered:
Ah I didn't see http://pandas.pydata.org/pandas-docs/version/0.19.2/gotchas.html#label-based-slicing-conventions
Sorry, something went wrong.
No branches or pull requests
Slicing a Dataset with a slice object includes the upper bound, which is different from python, numpy etc.
python 2.7.12, xarray 0.9.6. #1492 (comment) may be relevant, a quick search didn't reveal other issues:
The following illustrates the issue:
produces
The text was updated successfully, but these errors were encountered: