# xarray.CFTimeIndex.nunique

#### CFTimeIndex.nunique(dropna=True)[[source]](https://github.com/pydata/xarray/blob/main/xarray/../.pixi/envs/doc/lib/python3.15/site-packages/pandas/core/base.py#L1218-L1257)

Return number of unique elements in the object.

Excludes NA values by default.

* **Parameters:**
  **dropna** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool), *default* [`True`](https://docs.python.org/3/builtins/constants.html#True)) – Don’t include NaN in the count.
* **Returns:**
  [`int`](https://docs.python.org/3/builtins/functions.html#int) – An integer indicating the number of unique elements in the object.

#### SEE ALSO
`DataFrame.nunique`
: Method nunique for DataFrame.

`Series.count`
: Count non-NA/null observations in the Series.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('7efe498f-9f72-4b36-8192-460c063aced1','778d84b6-e23a-4297-82b2-1faa90c0777e','d8731c8f-76de-4f46-8a92-7aba58097818','../lite/tree/../notebooks/index.html?path=16e66b32_f2c3_47b1_9ae8_c1e49d306347.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> s = pd.Series([1, 3, 5, 7, 7])
>>> s
0    1
1    3
2    5
3    7
4    7
dtype: int64
```

```pycon
>>> s.nunique()
4
```

<div id="d8731c8f-76de-4f46-8a92-7aba58097818" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('7efe498f-9f72-4b36-8192-460c063aced1','d8731c8f-76de-4f46-8a92-7aba58097818')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('7efe498f-9f72-4b36-8192-460c063aced1','d8731c8f-76de-4f46-8a92-7aba58097818')">Open In Tab</button></div><div id="778d84b6-e23a-4297-82b2-1faa90c0777e" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
