# 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('70089b7a-ce7e-4566-a76b-0cdf1d0a5d39','7507397a-dc6b-4914-a6c1-d29d2e8b30b2','5193ebcb-235e-4263-abc1-8f7078d49efc','../lite/tree/../notebooks/index.html?path=d8660ae4_a8f9_4d73_b064_0a447c20e68d.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="5193ebcb-235e-4263-abc1-8f7078d49efc" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('70089b7a-ce7e-4566-a76b-0cdf1d0a5d39','5193ebcb-235e-4263-abc1-8f7078d49efc')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('70089b7a-ce7e-4566-a76b-0cdf1d0a5d39','5193ebcb-235e-4263-abc1-8f7078d49efc')">Open In Tab</button></div><div id="7507397a-dc6b-4914-a6c1-d29d2e8b30b2" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
