lastCol

open fun SingleColumn<DataRow<*>>.lastCol(condition: (ColumnWithPath<*>) -> Boolean = { true }): SingleColumn<*>

Last (Col)

Returns the last column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.

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

NOTE: For column groups, last is named lastCol instead to avoid confusion.

For more information: See First (Col), Last (Col), Single (Col) on the documentation website.

Check out: Grammar

Examples:

df.select{ last{ it.name().startsWith("order") } }

df.select{ "myColumnGroup".lastCol{ it.name().startsWith("order") } }

Examples for this overload:

df.select{ myColumnGroup.lastCol() }

Return

A SingleColumn containing the last column that adheres to the given condition.

Parameters

condition

The optional ColumnFilter condition that the column must adhere to.

See also

Throws

if no column adheres to the given condition.


open fun String.lastCol(condition: (ColumnWithPath<*>) -> Boolean = { true }): SingleColumn<*>

Last (Col)

Returns the last column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.

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

NOTE: For column groups, last is named lastCol instead to avoid confusion.

For more information: See First (Col), Last (Col), Single (Col) on the documentation website.

Check out: Grammar

Examples:

df.select{ last{ it.name().startsWith("order") } }

df.select{ "myColumnGroup".lastCol{ it.name().startsWith("order") } }

Examples for this overload:

df.select{ "myColumnGroup".lastCol{ it.name().startsWith("year") } }

Return

A SingleColumn containing the last column that adheres to the given condition.

Parameters

condition

The optional ColumnFilter condition that the column must adhere to.

See also

Throws

if no column adheres to the given condition.


open fun ColumnPath.lastCol(condition: (ColumnWithPath<*>) -> Boolean = { true }): SingleColumn<*>

Last (Col)

Returns the last column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.

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

NOTE: For column groups, last is named lastCol instead to avoid confusion.

For more information: See First (Col), Last (Col), Single (Col) on the documentation website.

Check out: Grammar

Examples:

df.select{ last{ it.name().startsWith("order") } }

df.select{ "myColumnGroup".lastCol{ it.name().startsWith("order") } }

Examples for this overload:

df.select{ "pathTo"["myColumnGroup"].lastCol{ it.name().startsWith("year") } }

Return

A SingleColumn containing the last column that adheres to the given condition.

Parameters

condition

The optional ColumnFilter condition that the column must adhere to.

See also

Throws

if no column adheres to the given condition.


open fun KProperty<*>.lastCol(condition: (ColumnWithPath<*>) -> Boolean = { true }): SingleColumn<*>

Deprecated

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

Last (Col)

Returns the last column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.

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

NOTE: For column groups, last is named lastCol instead to avoid confusion.

For more information: See First (Col), Last (Col), Single (Col) on the documentation website.

Check out: Grammar

Examples:

df.select{ last{ it.name().startsWith("order") } }

df.select{ "myColumnGroup".lastCol{ it.name().startsWith("order") } }

Examples for this overload:

df.select{ Type::myColumnGroup.lastCol{ it.name().startsWith("year") } }

df.select{ DataSchemaType::myColumnGroup.lastCol() }

Return

A SingleColumn containing the last column that adheres to the given condition.

Parameters

condition

The optional ColumnFilter condition that the column must adhere to.

See also

Throws

if no column adheres to the given condition.