# 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('bb310d9c-7701-4ccd-8488-27720bdb1582','63456a1b-1697-47ee-b15a-0fa0547a5d25','d4642b39-793b-4b51-9398-6bc2c8fa247b','../lite/tree/../notebooks/index.html?path=f6b62b2b_c427_4dee_bf5a_25e20484490b.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="d4642b39-793b-4b51-9398-6bc2c8fa247b" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('bb310d9c-7701-4ccd-8488-27720bdb1582','d4642b39-793b-4b51-9398-6bc2c8fa247b')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('bb310d9c-7701-4ccd-8488-27720bdb1582','d4642b39-793b-4b51-9398-6bc2c8fa247b')">Open In Tab</button></div><div id="63456a1b-1697-47ee-b15a-0fa0547a5d25" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
