# xarray.CFTimeIndex.dropna

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

Return Index without NA/NaN values.

Removes missing values from the Index, returning a shorter Index
containing only non-NA entries.

* **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('9324d17e-c90c-42a0-b85b-c61e85ebc68d','d5a6b456-bb36-4772-99d0-a95531523de2','8dd58455-5822-45ec-9bcf-3b07486d845f','../lite/tree/../notebooks/index.html?path=e4ac0f1a_15a9_4ad2_8db8_df2636200ae5.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="8dd58455-5822-45ec-9bcf-3b07486d845f" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('9324d17e-c90c-42a0-b85b-c61e85ebc68d','8dd58455-5822-45ec-9bcf-3b07486d845f')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('9324d17e-c90c-42a0-b85b-c61e85ebc68d','8dd58455-5822-45ec-9bcf-3b07486d845f')">Open In Tab</button></div><div id="d5a6b456-bb36-4772-99d0-a95531523de2" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
