# xarray.CFTimeIndex.has_duplicates

#### *property* CFTimeIndex.has_duplicates

Check if the Index has duplicate values.

* **Returns:**
  [`bool`](https://docs.python.org/3/builtins/functions.html#bool) – Whether or not the Index has duplicate values.

#### SEE ALSO
`Index.is_unique`
: Inverse method that checks if it has unique values.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('bfd05838-dac7-4b8e-8087-f0b21a94c7cf','032623a2-720d-4405-bbfa-697aeb030881','2b220704-b324-4f6f-ab60-d7b30330555a','../lite/tree/../notebooks/index.html?path=602297ac_3d1a_4620_a71d_0ff8a758d8f2.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> idx = pd.Index([1, 5, 7, 7])
>>> idx.has_duplicates
True
```

```pycon
>>> idx = pd.Index([1, 5, 7])
>>> idx.has_duplicates
False
```

```pycon
>>> idx = pd.Index(["Watermelon", "Orange", "Apple", "Watermelon"]).astype(
...     "category"
... )
>>> idx.has_duplicates
True
```

```pycon
>>> idx = pd.Index(["Orange", "Apple", "Watermelon"]).astype("category")
>>> idx.has_duplicates
False
```

<div id="2b220704-b324-4f6f-ab60-d7b30330555a" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('bfd05838-dac7-4b8e-8087-f0b21a94c7cf','2b220704-b324-4f6f-ab60-d7b30330555a')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('bfd05838-dac7-4b8e-8087-f0b21a94c7cf','2b220704-b324-4f6f-ab60-d7b30330555a')">Open In Tab</button></div><div id="032623a2-720d-4405-bbfa-697aeb030881" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
