Skip to content

Support label-based slicing in RangeIndex #10533

Open
@dcherian

Description

@dcherian

What happened?

import xarray as xr

idx1 = xr.indexes.RangeIndex.arange(0.0, 1000.0, 1e-9, dim="x")
ds1 = xr.Dataset(coords=xr.Coordinates.from_xindex(idx1))
ds1.sel(x=slice(1, 2))

raises

ValueError: RangeIndex only supports selection with method='nearest'

I think this should work

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions