take

Returns a DataColumn containing the first n values of this DataColumn.

If n is greater than or equal to the size of this DataColumn, this DataColumn is returned as is.

For more information: See take on the documentation website.

See also:

  • takeLast — takes the last n values instead.

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

  • dropLast — drops the last n values.

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

Return

A DataColumn containing the first n values of this DataColumn, or this DataColumn if n is greater than or equal to its size.

Parameters

n

The number of values to take. Must not be negative.

Throws


fun <T> DataFrame<T>.take(n: Int): DataFrame<T>

Returns a DataFrame containing the first n rows.

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

For more information: See take on the documentation website.

See also:

  • takeLast — takes the last n rows instead.

  • takeWhile — takes the first rows while the predicate holds.

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

  • filter — keeps every row that matches the predicate.

Return

A DataFrame containing the first n rows, or the whole DataFrame if n is greater than or equal to the number of rows.

Parameters

n

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

Throws