# xarray.CFTimeIndex.get_indexer_non_unique

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

Compute indexer and mask for new index given the current index.

The indexer should be then used as an input to ndarray.take to align the
current data to the new index.

* **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:**
  * **indexer** (`np.ndarray[np.intp]`) – Integers from 0 to n - 1 indicating that the index at these
    positions matches the corresponding target values. Missing values
    in the target are marked by -1.
  * **missing** (`np.ndarray[np.intp]`) – An indexer into the target of the values not found.
    These correspond to the -1 in the indexer array.

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

`Index.get_indexer_for`
: Returns an indexer even when non-unique.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('86ee7936-5c76-4712-bebf-3bced78fb73d','96d5fcae-157c-4d30-9873-28c8bf63c1cf','fc78cb62-5c3e-4f5e-a84a-f01c9b94636c','../lite/tree/../notebooks/index.html?path=e960e064_5c9c_4d20_88c3_ac1b19ad8e3e.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> index = pd.Index(["c", "b", "a", "b", "b"])
>>> index.get_indexer_non_unique(["b", "b"])
(array([1, 3, 4, 1, 3, 4]), array([], dtype=int64))
```

In the example below there are no matched values.

```pycon
>>> index = pd.Index(["c", "b", "a", "b", "b"])
>>> index.get_indexer_non_unique(["q", "r", "t"])
(array([-1, -1, -1]), array([0, 1, 2]))
```

For this reason, the returned `indexer` contains only integers equal to -1.
It demonstrates that there’s no match between the index and the `target`
values at these positions. The mask [0, 1, 2] in the return value shows that
the first, second, and third elements are missing.

Notice that the return value is a tuple contains two items. In the example
below the first item is an array of locations in `index`. The second
item is a mask shows that the first and third elements are missing.

```pycon
>>> index = pd.Index(["c", "b", "a", "b", "b"])
>>> index.get_indexer_non_unique(["f", "b", "s"])
(array([-1,  1,  3,  4, -1]), array([0, 2]))
```

<div id="fc78cb62-5c3e-4f5e-a84a-f01c9b94636c" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('86ee7936-5c76-4712-bebf-3bced78fb73d','fc78cb62-5c3e-4f5e-a84a-f01c9b94636c')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('86ee7936-5c76-4712-bebf-3bced78fb73d','fc78cb62-5c3e-4f5e-a84a-f01c9b94636c')">Open In Tab</button></div><div id="96d5fcae-157c-4d30-9873-28c8bf63c1cf" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
