# xarray.CFTimeIndex.intersection

#### CFTimeIndex.intersection(other, sort=False)[[source]](https://github.com/pydata/xarray/blob/main/xarray/../.pixi/envs/doc/lib/python3.14/site-packages/pandas/core/indexes/base.py#L3242-L3336)

Form the intersection of two Index objects.

This returns a new Index with elements common to the index and other.

* **Parameters:**
  * **other** ([`Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index) or [array-like](https://numpy.org/doc/stable/glossary.html#term-array_like)) – An Index or an array-like object containing elements to form the
    intersection with the original Index.
  * **sort** ([`True`](https://docs.python.org/3/builtins/constants.html#True), [`False`](https://docs.python.org/3/builtins/constants.html#False) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *default* [`False`](https://docs.python.org/3/builtins/constants.html#False)) – Whether to sort the resulting index.
    * None : sort the result, except when self and other are equal
      or when the values cannot be compared.
    * False : do not sort the result.
    * True : Sort the result (which may raise TypeError).
* **Returns:**
  [`Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index) – Returns a new Index object with elements common to both the original Index
  and the other Index.

#### SEE ALSO
`Index.union`
: Form the union of two Index objects.

`Index.difference`
: Return a new Index with elements of index not in other.

`Index.isin`
: Return a boolean array where the index values are in values.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('799b3784-dbe6-46e1-a19b-c55531b59330','e8e38690-2cb1-44eb-b5fd-17e917c0bcf8','6155fdaf-245f-4d14-9baf-790c777dfcd3','../lite/tree/../notebooks/index.html?path=c4bc0f73_9ff5_40c1_8afe_a4b5f6d288a9.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> idx1 = pd.Index([1, 2, 3, 4])
>>> idx2 = pd.Index([3, 4, 5, 6])
>>> idx1.intersection(idx2)
Index([3, 4], dtype='int64')
```

<div id="6155fdaf-245f-4d14-9baf-790c777dfcd3" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('799b3784-dbe6-46e1-a19b-c55531b59330','6155fdaf-245f-4d14-9baf-790c777dfcd3')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('799b3784-dbe6-46e1-a19b-c55531b59330','6155fdaf-245f-4d14-9baf-790c777dfcd3')">Open In Tab</button></div><div id="e8e38690-2cb1-44eb-b5fd-17e917c0bcf8" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
