dropLast

fun <T> DataColumn<T>.dropLast(n: Int = 1): DataColumn<T>

Returns a DataColumn containing all values of this DataColumn except the last n values.

If n is zero or negative, this DataColumn is returned as is.

For more information: See dropLast on the documentation website.

See also:

  • drop(n: Int) — drops the first n values instead.

  • takeLast — keeps only the last n values.

  • take — keeps only the first n values.

  • drop{ predicate: Predicate<T> } — drops every value that matches the predicate.

Return

A DataColumn containing all values of this DataColumn except the last n, or this DataColumn if n is zero or negative.

Parameters

n

The number of values to drop. Must not exceed the size of this DataColumn.

Throws

if n is greater than the size of this DataColumn.


fun <T> DataFrame<T>.dropLast(n: Int = 1): DataFrame<T>

Returns a DataFrame containing all rows except the last n rows.

If n is greater than or equal to the number of rows, an empty DataFrame is returned.

For more information: See dropLast on the documentation website.

See also:

  • drop(n: Int) — drops the first n rows instead.

  • dropWhile — drops the first rows while the predicate holds.

  • takeLast — keeps only the last n rows.

  • drop{ predicate: RowFilter<T> } — drops every row that matches the predicate.

Return

A DataFrame containing all rows except the last n, or an empty DataFrame if n is greater than or equal to the number of rows.

Parameters

n

The number of rows to drop. Must not be negative.

Throws