# xarray.CFTimeIndex.reindex

#### CFTimeIndex.reindex(target, method=None, level=None, limit=None, tolerance=None)[[source]](https://github.com/pydata/xarray/blob/main/xarray/../.pixi/envs/doc/lib/python3.14/site-packages/pandas/core/indexes/base.py#L4147-L4258)

Create index with target’s values.

* **Parameters:**
  * **target** (`an iterable`) – An iterable containing the values to be used for creating the new index.
  * **method** (`{None, 'pad'/'ffill', 'backfill'/'bfill', 'nearest'}`, *optional*) –
    * default: exact matches only.
    * pad / ffill: find the PREVIOUS index value if no exact match.
    * backfill / bfill: use NEXT index value if no exact match
    * nearest: use the NEAREST index value if no exact match. Tied
      distances are broken by preferring the larger index value.
  * **level** ([`int`](https://docs.python.org/3/builtins/functions.html#int), *optional*) – Level of multiindex.
  * **limit** ([`int`](https://docs.python.org/3/builtins/functions.html#int), *optional*) – Maximum number of consecutive labels in `target` to match for
    inexact matches.
  * **tolerance** ([`int`](https://docs.python.org/3/builtins/functions.html#int), [`float`](https://docs.python.org/3/builtins/functions.html#float), or `list-like`, *optional*) – Maximum distance between original and new labels for inexact
    matches. The values of the index at the matching locations must
    satisfy the equation `abs(index[indexer] - target) <= tolerance`.

    Tolerance may be a scalar value, which applies the same tolerance
    to all values, or list-like, which applies variable tolerance per
    element. List-like includes list, tuple, array, Series, and must be
    the same size as the index and its dtype must exactly match the
    index’s type.
* **Returns:**
  * **new_index** ([`Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index)) – Resulting index.
  * **indexer** (`np.ndarray[np.intp]` or [`None`](https://docs.python.org/3/builtins/constants.html#None)) – Indices of output values in original index.
* **Raises:**
  * [**TypeError**](https://docs.python.org/3/builtins/exceptions.html#TypeError) – If `method` passed along with `level`.
  * [**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError) – If non-unique multi-index
  * [**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError) – If non-unique index and `method` or `limit` passed.

#### SEE ALSO
`Series.reindex`
: Conform Series to new index with optional filling logic.

`DataFrame.reindex`
: Conform DataFrame to new index with optional filling logic.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('f8b80dbc-ce8e-4234-b77f-b2c7a2be1892','43f8aa48-642a-42f1-bdb6-b4ff125fed76','1390cf95-4b0b-4b4f-a2a3-a021797512af','../lite/tree/../notebooks/index.html?path=b4082fd6_407e_4b6e_a410_724fc8138b98.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> idx = pd.Index(["car", "bike", "train", "tractor"])
>>> idx
Index(['car', 'bike', 'train', 'tractor'], dtype='str')
>>> idx.reindex(["car", "bike"])
(Index(['car', 'bike'], dtype='str'), array([0, 1]))
```

<div id="1390cf95-4b0b-4b4f-a2a3-a021797512af" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('f8b80dbc-ce8e-4234-b77f-b2c7a2be1892','1390cf95-4b0b-4b4f-a2a3-a021797512af')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('f8b80dbc-ce8e-4234-b77f-b2c7a2be1892','1390cf95-4b0b-4b4f-a2a3-a021797512af')">Open In Tab</button></div><div id="43f8aa48-642a-42f1-bdb6-b4ff125fed76" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
