# drop / dropNulls / dropNaNs / dropNA

> For the complete documentation index, see [llms.txt](https://kotlin.github.io/dataframe/llms.txt).

API reference: [drop](https://kotlin.github.io/dataframe/api-docs/core/org.jetbrains.kotlinx.dataframe.api/drop.html)

The examples on this page use the following dataframe:

```KOTLIN
df
```

[Embedded content](./resources/dropDf.html)

## drop

Removes all rows that satisfy the [row condition](datarow.html#row-conditions).

Related operations: [Filter rows](filterrows.html)

Properties:

```KOTLIN
df.drop { weight == null || name == null }
```

Strings:

```KOTLIN
df.drop { it["weight"] == null || it["name"] == null }
```

[Embedded content](./resources/dropWhere.html)

If called on a [DataColumn](datacolumn.html), removes all the values that match the predicate and returns a [DataColumn](datacolumn.html) containing the values that do not match the predicate.

```KOTLIN
df.weight.drop { it != null && it < 60 }
```

[Embedded content](./resources/dropDataColumnByPredicate.html)

## dropNulls

Removes rows with `null` values. This is a DataFrame equivalent of `filterNotNull`.

See also [fillNulls](fill.html#fillnulls), which replaces `null` values instead of removing rows.

See [column selectors](columnselectors.html) for how to select the columns for this operation.

```KOTLIN
// remove rows with null value in any column
df.dropNulls()
```

[Embedded content](./resources/dropNulls.html)

```KOTLIN
// remove rows with null values in all columns
df.dropNulls(whereAllNull = true)
```

[Embedded content](./resources/dropNullsWhereAllNull.html)

```KOTLIN
// remove rows with null value in 'name' column
df.dropNulls { name }
```

[Embedded content](./resources/dropNullsSelector.html)

```KOTLIN
// remove rows with null value in 'name' OR 'weight' columns
df.dropNulls { name and weight }
```

[Embedded content](./resources/dropNullsSelectorSeveralCols.html)

```KOTLIN
// remove rows with nulls in both 'name' and 'weight' columns
df.dropNulls(whereAllNull = true) { name and weight }
```

[Embedded content](./resources/dropNullsWhereAllNullSelector.html)

If called on a [DataColumn](datacolumn.html), removes `null` values from this [DataColumn](datacolumn.html), adjusting the type accordingly.

```KOTLIN
df.weight.dropNulls()
```

[Embedded content](./resources/dropNullsDataColumn.html)

## dropNaNs

Removes rows with [NaN values](nanandna.html#nan) (`Double.NaN` or `Float.NaN`).

See also [fillNaNs](fill.html#fillnans), which replaces [NaN values](nanandna.html#nan) instead of removing rows.

See [column selectors](columnselectors.html) for how to select the columns for this operation.

```KOTLIN
// remove rows containing NaN in any column
df.dropNaNs()
```

[Embedded content](./resources/dropNaNs.html)

```KOTLIN
// remove rows with NaN in all columns of type `Double?`
df.dropNaNs(whereAllNaN = true) { colsOf<Double?>() }
```

[Embedded content](./resources/dropNaNsWhereAllNaN.html)

```KOTLIN
// remove rows where 'weight' is NaN
df.dropNaNs { weight }
```

[Embedded content](./resources/dropNaNsSelector.html)

```KOTLIN
// remove rows where either 'age' or 'weight' is NaN
df.dropNaNs { age and weight }
```

[Embedded content](./resources/dropNaNsSelectorSeveralCols.html)

```KOTLIN
// remove rows where both 'age' and 'weight' are NaN
df.dropNaNs(whereAllNaN = true) { age and weight }
```

[Embedded content](./resources/dropNaNsWhereAllNaNSelector.html)

If called on a [DataColumn](datacolumn.html), removes [NaN values](nanandna.html#nan) from this [DataColumn](datacolumn.html), adjusting the type accordingly.

```KOTLIN
df.weight.dropNaNs()
```

[Embedded content](./resources/dropNaNsDataColumn.html)

## dropNA

Removes rows with [NA values](nanandna.html#na) (`null`, `Double.NaN`, or `Float.NaN`).

See also [fillNA](fill.html#fillna), which replaces [NA values](nanandna.html#na) instead of removing rows.

See [column selectors](columnselectors.html) for how to select the columns for this operation.

```KOTLIN
// remove rows containing null or NaN in any column
df.dropNA()
```

[Embedded content](./resources/dropNA.html)

```KOTLIN
// remove rows with null or NaN in all columns
df.dropNA(whereAllNA = true)
```

[Embedded content](./resources/dropNAWhereAllNA.html)

```KOTLIN
// remove rows where 'weight' is null or NaN
df.dropNA { weight }
```

[Embedded content](./resources/dropNASelector.html)

```KOTLIN
// remove rows where either 'age' or 'weight' is null or NaN
df.dropNA { age and weight }
```

[Embedded content](./resources/dropNASelectorSeveralCols.html)

```KOTLIN
// remove rows where both 'age' and 'weight' are null or NaN
df.dropNA(whereAllNA = true) { age and weight }
```

[Embedded content](./resources/dropNAWhereAllNASelector.html)

If called on a [DataColumn](datacolumn.html), removes [NA values](nanandna.html#na) from this [DataColumn](datacolumn.html), adjusting the type accordingly.

```KOTLIN
df.weight.dropNA()
```

[Embedded content](./resources/dropNADataColumn.html)

