# xarray.CFTimeIndex.get_indexer_for

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

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('5686fb7b-35e6-48e7-9446-7a2a43241f4b','af564e43-e6fa-4d42-bfc7-73495c2e7752','820294ad-fae4-4a97-86ee-596525dc0d23','../lite/tree/../notebooks/index.html?path=5a2d30d5_032b_4b91_b6f3_779055a399e7.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="820294ad-fae4-4a97-86ee-596525dc0d23" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('5686fb7b-35e6-48e7-9446-7a2a43241f4b','820294ad-fae4-4a97-86ee-596525dc0d23')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('5686fb7b-35e6-48e7-9446-7a2a43241f4b','820294ad-fae4-4a97-86ee-596525dc0d23')">Open In Tab</button></div><div id="af564e43-e6fa-4d42-bfc7-73495c2e7752" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
