# xarray.CFTimeIndex.nunique

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

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('ad6cadf5-553d-4dee-a402-d7ac26eff0a7','fe7b580f-d741-4f64-826b-7f36140e9e30','bf9a8d84-51ef-49c6-9108-363e4621f6ca','../lite/tree/../notebooks/index.html?path=de814463_dc6a_48bc_82e9_e58430ae0f68.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="bf9a8d84-51ef-49c6-9108-363e4621f6ca" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('ad6cadf5-553d-4dee-a402-d7ac26eff0a7','bf9a8d84-51ef-49c6-9108-363e4621f6ca')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('ad6cadf5-553d-4dee-a402-d7ac26eff0a7','bf9a8d84-51ef-49c6-9108-363e4621f6ca')">Open In Tab</button></div><div id="fe7b580f-d741-4f64-826b-7f36140e9e30" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
