# xarray.CFTimeIndex.equals

#### CFTimeIndex.equals(other)[[source]](https://github.com/pydata/xarray/blob/main/xarray/../.pixi/envs/doc/lib/python3.14/site-packages/pandas/core/indexes/base.py#L5584-L5684)

Determine if two Index object are equal.

The things that are being compared are:

* The elements inside the Index object.
* The order of the elements inside the Index object.

* **Parameters:**
  **other** (`Any`) – The other object to compare against.
* **Returns:**
  [`bool`](https://docs.python.org/3/builtins/functions.html#bool) – True if “other” is an Index and it has the same elements and order
  as the calling index; False otherwise.

#### SEE ALSO
`Index.identical`
: Checks that object attributes and types are also equal.

`Index.has_duplicates`
: Check if the Index has duplicate values.

`Index.is_unique`
: Return if the index has unique values.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('5f3cd224-584d-48bc-ba59-d8b82f28819b','371f6040-5566-46ff-92a4-b40393b34053','0b653898-656c-417d-8a1c-944596efb802','../lite/tree/../notebooks/index.html?path=62602817_f461_4253_8b87_2cd119d293ff.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> idx1 = pd.Index([1, 2, 3])
>>> idx1
Index([1, 2, 3], dtype='int64')
>>> idx1.equals(pd.Index([1, 2, 3]))
True
```

The elements inside are compared

```pycon
>>> idx2 = pd.Index(["1", "2", "3"])
>>> idx2
Index(['1', '2', '3'], dtype='str')
```

```pycon
>>> idx1.equals(idx2)
False
```

The order is compared

```pycon
>>> ascending_idx = pd.Index([1, 2, 3])
>>> ascending_idx
Index([1, 2, 3], dtype='int64')
>>> descending_idx = pd.Index([3, 2, 1])
>>> descending_idx
Index([3, 2, 1], dtype='int64')
>>> ascending_idx.equals(descending_idx)
False
```

The dtype is *not* compared

```pycon
>>> int64_idx = pd.Index([1, 2, 3], dtype="int64")
>>> int64_idx
Index([1, 2, 3], dtype='int64')
>>> uint64_idx = pd.Index([1, 2, 3], dtype="uint64")
>>> uint64_idx
Index([1, 2, 3], dtype='uint64')
>>> int64_idx.equals(uint64_idx)
True
```

<div id="0b653898-656c-417d-8a1c-944596efb802" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('5f3cd224-584d-48bc-ba59-d8b82f28819b','0b653898-656c-417d-8a1c-944596efb802')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('5f3cd224-584d-48bc-ba59-d8b82f28819b','0b653898-656c-417d-8a1c-944596efb802')">Open In Tab</button></div><div id="371f6040-5566-46ff-92a4-b40393b34053" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
