take

open fun <C> ColumnSet<C>.take(n: Int): ColumnSet<C>

Take (Cols)

This collects the first n columns from this into a ColumnSet.

This function operates solely on columns at the top-level.

Any Access APIs can be used as receiver for these functions.

NOTE: To avoid ambiguity, take is called takeCols when called on a ColumnGroup.

For more information: See take(Last)(Cols)(While) on the documentation website.

Check out: Grammar

Examples:

df.select{ cols{ "my" init.name}.take(5) }

df.select{ take(1) }

df.select{ myColumnGroup.takeCols(2) }

df.select{ "myColumnGroup".takeCols(3) }

Examples for this overload:

df.select{ colsOf<String>().take(2) }

df.select{ cols{ .. }.take(2) }

See also:

  • takeLast — takes the last n columns instead.

  • takeWhile — takes the first columns while a predicate holds.

  • takeLastWhile — takes the last columns while a predicate holds.

  • drop — drops the first n columns.

Return

A ColumnSet containing the first n columns.

Parameters

n

The number of columns to take.


Take (Cols)

This collects the first n columns from this into a ColumnSet.

This function operates solely on columns at the top-level.

Any Access APIs can be used as receiver for these functions.

NOTE: To avoid ambiguity, take is called takeCols when called on a ColumnGroup.

For more information: See take(Last)(Cols)(While) on the documentation website.

Check out: Grammar

Examples:

df.select{ cols{ "my" init.name}.take(5) }

df.select{ take(1) }

df.select{ myColumnGroup.takeCols(2) }

df.select{ "myColumnGroup".takeCols(3) }

Examples for this overload:

df.select{ take(5) }

See also:

  • takeLast — takes the last n columns instead.

  • takeWhile — takes the first columns while a predicate holds.

  • takeLastWhile — takes the last columns while a predicate holds.

  • drop — drops the first n columns.

Return

A ColumnSet containing the first n columns.

Parameters

n

The number of columns to take.