# 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('9ea40df9-ae32-4585-8d20-09dcd07a8689','0cfe6185-bdee-4e9f-92b6-fed1328aaf87','5a91bef2-bfef-458d-abc7-84e88bacaea4','../lite/tree/../notebooks/index.html?path=d0f66f52_4efc_4bfa_a12d_d9d700aa2bab.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="5a91bef2-bfef-458d-abc7-84e88bacaea4" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('9ea40df9-ae32-4585-8d20-09dcd07a8689','5a91bef2-bfef-458d-abc7-84e88bacaea4')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('9ea40df9-ae32-4585-8d20-09dcd07a8689','5a91bef2-bfef-458d-abc7-84e88bacaea4')">Open In Tab</button></div><div id="0cfe6185-bdee-4e9f-92b6-fed1328aaf87" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
