# dask.dataframe.DataFrame.dropna

#### DataFrame.dropna(how=<no_default>, subset=None, thresh=<no_default>)

Remove missing values.

This docstring was copied from pandas.DataFrame.dropna.

Some inconsistencies with the Dask version may exist.

See the [User Guide](https://pandas.pydata.org/pandas-docs/stable/user_guide/missing_data.html#missing-data) for more on which values are
considered missing, and how to work with missing data.

* **Parameters:**
  **axis**
  : Determine if rows or columns which contain missing values are
    removed.
    * 0, or ‘index’ : Drop rows which contain missing values.
    * 1, or ‘columns’ : Drop columns which contain missing values.
    <br/>
    Only a single axis is allowed.

  **how**
  : Determine if row or column is removed from DataFrame, when we have
    at least one NA or all NA.
    * ‘any’ : If any NA values are present, drop that row or column.
    * ‘all’ : If all values are NA, drop that row or column.

  **thresh**
  : Require that many non-NA values. Cannot be combined with how.

  **subset**
  : Labels along other axis to consider, e.g. if you are dropping rows
    these would be a list of columns to include.

  **inplace**
  : Whether to modify the DataFrame rather than creating a new one.
    <br/>
    #### Deprecated
    Deprecated since version 3.1.0: This keyword is deprecated and will be removed in pandas 4.0.
    See the [whatsnew note on PDEP-8](https://pandas.pydata.org/docs/dev/whatsnew/v3.1.0.html#deprecation-inplace)
    for more details.

  **ignore_index**
  : If `True`, the resulting axis will be labeled 0, 1, …, n - 1.
    <br/>
    #### Versionadded
    Added in version 2.0.0.
* **Returns:**
  DataFrame or None
  : DataFrame with NA entries dropped from it or None if `inplace=True`.

#### SEE ALSO
[`DataFrame.isna`](dask.dataframe.DataFrame.isna.html.md#dask.dataframe.DataFrame.isna)
: Indicate missing values.

`DataFrame.notna`
: Indicate existing (non-missing) values.

[`DataFrame.fillna`](dask.dataframe.DataFrame.fillna.html.md#dask.dataframe.DataFrame.fillna)
: Replace missing values.

[`Series.dropna`](dask.dataframe.Series.dropna.html.md#dask.dataframe.Series.dropna)
: Drop missing values.

[`Index.dropna`](dask.dataframe.Index.dropna.html.md#dask.dataframe.Index.dropna)
: Drop missing indices.

### Examples

```pycon
>>> df = pd.DataFrame(
...     {
...         "name": ["Alfred", "Batman", "Catwoman"],
...         "toy": [np.nan, "Batmobile", "Bullwhip"],
...         "born": [pd.NaT, pd.Timestamp("1940-04-25"), pd.NaT],
...     }
... )
>>> df
       name        toy       born
0    Alfred        NaN        NaT
1    Batman  Batmobile 1940-04-25
2  Catwoman   Bullwhip        NaT
```

Drop the rows where at least one element is missing.

```pycon
>>> df.dropna()
     name        toy       born
1  Batman  Batmobile 1940-04-25
```

Drop the columns where at least one element is missing.

```pycon
>>> df.dropna(axis="columns")
       name
0    Alfred
1    Batman
2  Catwoman
```

Drop the rows where all elements are missing.

```pycon
>>> df.dropna(how="all")
       name        toy       born
0    Alfred        NaN        NaT
1    Batman  Batmobile 1940-04-25
2  Catwoman   Bullwhip        NaT
```

Keep only the rows with at least 2 non-NA values.

```pycon
>>> df.dropna(thresh=2)
       name        toy       born
1    Batman  Batmobile 1940-04-25
2  Catwoman   Bullwhip        NaT
```

Define in which columns to look for missing values.

```pycon
>>> df.dropna(subset=["name", "toy"])
       name        toy       born
1    Batman  Batmobile 1940-04-25
2  Catwoman   Bullwhip        NaT
```

<!-- !! processed by numpydoc !! -->
