# xarray.CFTimeIndex.has_duplicates

#### *property* CFTimeIndex.has_duplicates

Check if the Index has duplicate values.

This is the inverse of `is_unique`. It returns `True`
if any value appears more than once in the index, `False` otherwise.

* **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('ab8fb36b-5941-4917-976e-a9264d8c8815','18d400cf-c36e-4534-a7a1-a1269837720a','dbd1c883-110e-45db-9f41-859b3a0afd56','../lite/tree/../notebooks/index.html?path=bd62ae8c_1188_4ce5_b1ea_c5aeefebdda9.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="dbd1c883-110e-45db-9f41-859b3a0afd56" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('ab8fb36b-5941-4917-976e-a9264d8c8815','dbd1c883-110e-45db-9f41-859b3a0afd56')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('ab8fb36b-5941-4917-976e-a9264d8c8815','dbd1c883-110e-45db-9f41-859b3a0afd56')">Open In Tab</button></div><div id="18d400cf-c36e-4534-a7a1-a1269837720a" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
