# xarray.CFTimeIndex.dropna

#### CFTimeIndex.dropna(how='any')[[source]](https://github.com/pydata/xarray/blob/main/xarray/../.pixi/envs/doc/lib/python3.14/site-packages/pandas/core/indexes/base.py#L2780-L2812)

Return Index without NA/NaN values.

* **Parameters:**
  **how** (`{'any', 'all'}`, *default* `'any'`) – If the Index is a MultiIndex, drop the value when any or all levels
  are NaN.
* **Returns:**
  [`Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index) – Returns an Index object after removing NA/NaN values.

#### SEE ALSO
`Index.fillna`
: Fill NA/NaN values with the specified value.

`Index.isna`
: Detect missing values.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('3e51e1b5-41be-4064-a794-340f315c47a8','74f76ce6-901b-47c7-8b80-53284cfc7c21','b97337b9-8268-429e-b8b2-a70668fa62e7','../lite/tree/../notebooks/index.html?path=422fd50d_0865_49de_b6c9_235e1e06c7b0.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> idx = pd.Index([1, np.nan, 3])
>>> idx.dropna()
Index([1.0, 3.0], dtype='float64')
```

<div id="b97337b9-8268-429e-b8b2-a70668fa62e7" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('3e51e1b5-41be-4064-a794-340f315c47a8','b97337b9-8268-429e-b8b2-a70668fa62e7')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('3e51e1b5-41be-4064-a794-340f315c47a8','b97337b9-8268-429e-b8b2-a70668fa62e7')">Open In Tab</button></div><div id="74f76ce6-901b-47c7-8b80-53284cfc7c21" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
