takeCols

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{ myColumnGroup.takeCols(1) }

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.


open fun String.takeCols(n: Int): ColumnSet<*>

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{ "myColumnGroup".takeCols(1) }

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.


open fun ColumnPath.takeCols(n: Int): ColumnSet<*>

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{ "pathTo"["myColumnGroup"].takeCols(1) }

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.


open fun KProperty<*>.takeCols(n: Int): ColumnSet<*>

Deprecated

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

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{ Type::myColumnGroup.takeCols(1) }

df.select{ DataSchemaType::myColumnGroup.takeCols(1) }

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.