# xarray.CFTimeIndex.get_indexer_for

#### CFTimeIndex.get_indexer_for(target)[[source]](https://github.com/pydata/xarray/blob/main/xarray/../.pixi/envs/doc/lib/python3.14/site-packages/pandas/core/indexes/base.py#L6252-L6286)

Guaranteed return of an indexer even when non-unique.

This dispatches to get_indexer or get_indexer_non_unique
as appropriate.

* **Parameters:**
  **target** ([`Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index)) – An iterable containing the values to be used for computing indexer.
* **Returns:**
  `np.ndarray[np.intp]` – List of indices.

#### SEE ALSO
`Index.get_indexer`
: Computes indexer and mask for new index given the current index.

`Index.get_non_unique`
: Returns indexer and masks for new index given the current index.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('d8bda723-4028-482f-acbe-1e50a63c67bf','442d4f2b-41b7-4449-8d30-ffc5d355dcee','55ca273e-8444-4877-ad36-b76973f727de','../lite/tree/../notebooks/index.html?path=3ca81899_7696_4707_8d7d_b3533c3e5dc6.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> idx = pd.Index([np.nan, "var1", np.nan])
>>> idx.get_indexer_for([np.nan])
array([0, 2])
```

<div id="55ca273e-8444-4877-ad36-b76973f727de" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('d8bda723-4028-482f-acbe-1e50a63c67bf','55ca273e-8444-4877-ad36-b76973f727de')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('d8bda723-4028-482f-acbe-1e50a63c67bf','55ca273e-8444-4877-ad36-b76973f727de')">Open In Tab</button></div><div id="442d4f2b-41b7-4449-8d30-ffc5d355dcee" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
