# xarray.indexes.RangeIndex

### *class* xarray.indexes.RangeIndex(transform)[[source]](https://github.com/pydata/xarray/blob/main/xarray/indexes/range_index.py#L147-L496)

Xarray index implementing a simple bounded 1-dimension interval with
evenly spaced, monotonic floating-point values.

This index is memory-saving, i.e., the values of its associated coordinate
variable are not materialized in memory.

Do not use [`__init__()`](#xarray.indexes.RangeIndex.__init__) directly. Instead
use [`arange()`](xarray.indexes.RangeIndex.arange.html.md#xarray.indexes.RangeIndex.arange) or
[`linspace()`](xarray.indexes.RangeIndex.linspace.html.md#xarray.indexes.RangeIndex.linspace), which are similar to
[`numpy.arange()`](https://numpy.org/doc/stable/reference/generated/numpy.arange.html#numpy.arange) and [`numpy.linspace()`](https://numpy.org/doc/stable/reference/generated/numpy.linspace.html#numpy.linspace).

In the case of a monotonic integer range, it is better using a
[`PandasIndex`](xarray.indexes.PandasIndex.html.md#xarray.indexes.PandasIndex) that wraps a
[`pandas.RangeIndex`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.RangeIndex.html#pandas.RangeIndex).

#### \_\_init_\_(transform)[[source]](https://github.com/pydata/xarray/blob/main/xarray/indexes/range_index.py#L167-L168)

### Methods

| [`__init__`](#xarray.indexes.RangeIndex.__init__)(transform)                                                             |                                                                                                  |
|----------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
| [`arange`](xarray.indexes.RangeIndex.arange.html.md#xarray.indexes.RangeIndex.arange)([start, stop, step, coord_name, dtype]) | Create a new RangeIndex from given start, stop and step values.                                  |
| `concat`(indexes, dim[, positions])                                                                                              | Create a new index by concatenating one or more indexes of the same type.                        |
| `copy`([deep])                                                                                                                   | Return a (deep) copy of this index.                                                              |
| `create_variables`([variables])                                                                                                  | Maybe create new coordinate variables from this index.                                           |
| `equals`(other, \*[, exclude, exact])                                                                                            | Check equality with another RangeIndex.                                                          |
| `from_variables`(variables, \*, options)                                                                                         | Create a new index object from one or more coordinate variables.                                 |
| `isel`(indexers)                                                                                                                 | Maybe returns a new index from the current index itself indexed by positional indexers.          |
| `join`(other[, how])                                                                                                             | Return a new index from the combination of this index with another index of the same type.       |
| [`linspace`](xarray.indexes.RangeIndex.linspace.html.md#xarray.indexes.RangeIndex.linspace)(start, stop[, num, endpoint, ...])  | Create a new RangeIndex from given start / stop values and number of values.                     |
| `reindex_like`(other)                                                                                                            | Query the index with another index of the same type.                                             |
| `rename`(name_dict, dims_dict)                                                                                                   | Maybe update the index with new coordinate and dimension names.                                  |
| `roll`(shifts)                                                                                                                   | Roll this index by an offset along one or more dimensions.                                       |
| `sel`(labels[, method, tolerance])                                                                                               | Query the index with arbitrary coordinate label indexers.                                        |
| `should_add_coord_to_array`(name, var, dims)                                                                                     | Define whether or not an index coordinate variable should be added to a new DataArray.           |
| `stack`(variables, dim)                                                                                                          | Create a new index by stacking coordinate variables into a single new dimension.                 |
| `to_pandas_index`()                                                                                                              | Cast this xarray index to a pandas.Index object or raise a `TypeError` if this is not supported. |
| `unstack`()                                                                                                                      | Unstack a (multi-)index into multiple (single) indexes.                                          |

### Attributes

| `coord_name`                                                                           |                                                                             |
|----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| `dim`                                                                                  |                                                                             |
| `size`                                                                                 |                                                                             |
| [`start`](xarray.indexes.RangeIndex.start.html.md#xarray.indexes.RangeIndex.start) | Returns the start of the interval (the interval includes this value).       |
| [`step`](xarray.indexes.RangeIndex.step.html.md#xarray.indexes.RangeIndex.step)   | Returns the spacing between values.                                         |
| [`stop`](xarray.indexes.RangeIndex.stop.html.md#xarray.indexes.RangeIndex.stop)   | Returns the end of the interval (the interval does not include this value). |
| `transform`                                                                            |                                                                             |
