dropNulls

fun <T> DataFrame<T>.dropNulls(whereAllNull: Boolean = false, columns: ColumnsSelector<T, *>): DataFrame<T>

The Drop Nulls Operation

Removes rows with null values. Specific case of drop.

Optionally, you can select which columns to operate on (see org.jetbrains.kotlinx.dataframe.api.DropNulls.DropNullsSelectingOptions).

Also, you can supply whereAllNull = true to only drop rows where all selected cells are null. By default, rows are dropped if any of the selected cells are null.

For more information: See dropNulls on the documentation website.

See also fillNulls, which replaces null values instead of removing rows.

This Drop Nulls Overload

Select or express columns using the Columns Selection DSL.

This DSL is initiated by a Columns Selector lambda, which operates in the context of the Columns Selection DSL and expects you to return a SingleColumn or ColumnSet (so, a ColumnsResolver). This is an entity formed by calling any (combination) of the functions in the DSL that is or can be resolved into one or more columns.

The Columns Selection DSL allows using Extension Properties for specifying columns type- and name-safe.

Check out: Columns Selection DSL Grammar

    

See Column Selectors on the documentation website.

For example:

df.dropNulls{ length andage }

df.dropNulls{ cols(1..5) }

df.dropNulls{ colsOf<Double>() }

df.dropNulls(whereAllNull = true) { colsOf<Double>() }

Parameters

whereAllNull

false by default. If true, rows are dropped if all selected cells are null. If false, rows are dropped if any of the selected cells is null.

columns

The Columns Selector used to select the columns of this DataFrame to drop rows in.


fun <T> DataFrame<T>.dropNulls(whereAllNull: Boolean = false): DataFrame<T>

The Drop Nulls Operation

Removes rows with null values. Specific case of drop.

Optionally, you can select which columns to operate on (see org.jetbrains.kotlinx.dataframe.api.DropNulls.DropNullsSelectingOptions).

Also, you can supply whereAllNull = true to only drop rows where all selected cells are null. By default, rows are dropped if any of the selected cells are null.

For more information: See dropNulls on the documentation website.

See also fillNulls, which replaces null values instead of removing rows.

This Drop Nulls Overload

This overload operates on all columns in the DataFrame.

Parameters

whereAllNull

false by default. If true, rows are dropped if all selected cells are null. If false, rows are dropped if any of the selected cells is null.


fun <T> DataFrame<T>.dropNulls(vararg columns: String, whereAllNull: Boolean = false): DataFrame<T>

The Drop Nulls Operation

Removes rows with null values. Specific case of drop.

Optionally, you can select which columns to operate on (see org.jetbrains.kotlinx.dataframe.api.DropNulls.DropNullsSelectingOptions).

Also, you can supply whereAllNull = true to only drop rows where all selected cells are null. By default, rows are dropped if any of the selected cells are null.

For more information: See dropNulls on the documentation website.

See also fillNulls, which replaces null values instead of removing rows.

This Drop Nulls Overload

df.dropNulls("length", whereAllNull = true)

Parameters

whereAllNull

false by default. If true, rows are dropped if all selected cells are null. If false, rows are dropped if any of the selected cells is null.

columns

The Strings corresponding to the names of columns in this DataFrame to drop rows in.


The Drop Nulls Operation

Removes null values from this DataColumn, adjusting the type accordingly.

For more information: See dropNulls on the documentation website.


fun <T> DataFrame<T>.dropNulls(vararg columns: KProperty<*>, whereAllNull: Boolean = false): DataFrame<T>

Deprecated

It's recommended to migrate to the String or Extension Properties Access API https://kotlin.github.io/dataframe/apilevels.html

The Drop Nulls Operation

Removes rows with null values. Specific case of drop.

Optionally, you can select which columns to operate on (see org.jetbrains.kotlinx.dataframe.api.DropNulls.DropNullsSelectingOptions).

Also, you can supply whereAllNull = true to only drop rows where all selected cells are null. By default, rows are dropped if any of the selected cells are null.

For more information: See dropNulls on the documentation website.

See also fillNulls, which replaces null values instead of removing rows.

This Drop Nulls Overload

df.dropNulls(Person::length, whereAllNull = true)

Parameters

whereAllNull

false by default. If true, rows are dropped if all selected cells are null. If false, rows are dropped if any of the selected cells is null.

columns

The KProperties used to select the columns of this DataFrame to drop rows in.


fun <T> DataFrame<T>.dropNulls(vararg columns: ColumnReference<*>, whereAllNull: Boolean = false): DataFrame<T>

Deprecated

It's recommended to migrate to the String or Extension Properties Access API https://kotlin.github.io/dataframe/apilevels.html

The Drop Nulls Operation

Removes rows with null values. Specific case of drop.

Optionally, you can select which columns to operate on (see org.jetbrains.kotlinx.dataframe.api.DropNulls.DropNullsSelectingOptions).

Also, you can supply whereAllNull = true to only drop rows where all selected cells are null. By default, rows are dropped if any of the selected cells are null.

For more information: See dropNulls on the documentation website.

See also fillNulls, which replaces null values instead of removing rows.

This Drop Nulls Overload

df.dropNulls(length, whereAllNull = true)

Parameters

whereAllNull

false by default. If true, rows are dropped if all selected cells are null. If false, rows are dropped if any of the selected cells is null.

columns

The Column References used to select the columns of this DataFrame to drop rows in.