distinctBy

fun <T> DataFrame<T>.distinctBy(vararg columns: String): DataFrame<T>

Removes duplicated rows based on the specified columns.

The rows in the resulting DataFrame are in the same order as they were in the original DataFrame.

See also distinct that selects the specified columns (if the columns are not specified, selects all columns) and keeps only distinct rows based on these selected columns.

This can include column groups and nested columns.

See Selecting Columns.

For more information: See distinct on the documentation website. See distinctBy on the documentation website.

Return

A new DataFrame containing only distinct rows.

Parameters

columns

The names of the columns to consider for evaluating distinct rows.


Removes duplicated rows based on the specified columns.

The rows in the resulting DataFrame are in the same order as they were in the original DataFrame.

See also distinct that selects the specified columns (if the columns are not specified, selects all columns) and keeps only distinct rows based on these selected columns.

This can include column groups and nested columns.

See Selecting Columns.

For more information: See distinct on the documentation website. See distinctBy on the documentation website.

Return

A new DataFrame containing only distinct rows.

Parameters

columns

The ColumnsSelector used to select columns that will be considered for evaluating distinct rows.


fun <T> DataFrame<T>.distinctBy(vararg columns: KProperty<*>): DataFrame<T>
fun <T> DataFrame<T>.distinctBy(vararg columns: ColumnReference<*>): DataFrame<T>

Deprecated

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