dropLastColsWhile

Drop Last (Cols) While

This operation drops the last columns from this while they adhere to the predicate, stops as soon as it encounters one that does not, and collects the remaining columns 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, dropLastWhile is called dropLastColsWhile when called on a String or ColumnPath resembling a ColumnGroup.

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

Check out: Grammar

Examples:

df.select{ cols{ "my" init.name}.dropLastWhile{ "my" init.name} }

df.select{ myColumnGroup.dropLastWhile{ it.any{ it == "Alice" } } }

df.select{ "myColumnGroup".dropLastColsWhile{ it.kind() == ColumnKind.Value} }

Examples for this overload:

df.select{ myColumnGroup.dropLastColsWhile{ it.name.startsWith("my") } }

See also:

  • drop — drops a fixed number of first columns.

  • dropLast — drops a fixed number of last columns.

  • dropWhile — drops the first columns while a predicate holds.

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

Return

A ColumnSet containing all columns except the last ones adhering to the predicate.

Parameters

predicate

The ColumnFilter to control which columns to drop.


open fun String.dropLastColsWhile(predicate: (ColumnWithPath<*>) -> Boolean): ColumnSet<*>

Drop Last (Cols) While

This operation drops the last columns from this while they adhere to the predicate, stops as soon as it encounters one that does not, and collects the remaining columns 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, dropLastWhile is called dropLastColsWhile when called on a String or ColumnPath resembling a ColumnGroup.

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

Check out: Grammar

Examples:

df.select{ cols{ "my" init.name}.dropLastWhile{ "my" init.name} }

df.select{ myColumnGroup.dropLastWhile{ it.any{ it == "Alice" } } }

df.select{ "myColumnGroup".dropLastColsWhile{ it.kind() == ColumnKind.Value} }

Examples for this overload:

df.select{ "myColumnGroup".dropLastColsWhile{ it.name.startsWith("my") } }

See also:

  • drop — drops a fixed number of first columns.

  • dropLast — drops a fixed number of last columns.

  • dropWhile — drops the first columns while a predicate holds.

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

Return

A ColumnSet containing all columns except the last ones adhering to the predicate.

Parameters

predicate

The ColumnFilter to control which columns to drop.


Drop Last (Cols) While

This operation drops the last columns from this while they adhere to the predicate, stops as soon as it encounters one that does not, and collects the remaining columns 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, dropLastWhile is called dropLastColsWhile when called on a String or ColumnPath resembling a ColumnGroup.

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

Check out: Grammar

Examples:

df.select{ cols{ "my" init.name}.dropLastWhile{ "my" init.name} }

df.select{ myColumnGroup.dropLastWhile{ it.any{ it == "Alice" } } }

df.select{ "myColumnGroup".dropLastColsWhile{ it.kind() == ColumnKind.Value} }

Examples for this overload:

df.select{ "pathTo"["myColumnGroup"].dropLastColsWhile{ it.name.startsWith("my") } }

See also:

  • drop — drops a fixed number of first columns.

  • dropLast — drops a fixed number of last columns.

  • dropWhile — drops the first columns while a predicate holds.

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

Return

A ColumnSet containing all columns except the last ones adhering to the predicate.

Parameters

predicate

The ColumnFilter to control which columns to drop.


open fun KProperty<*>.dropLastColsWhile(predicate: (ColumnWithPath<*>) -> Boolean): ColumnSet<*>

Deprecated

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

Drop Last (Cols) While

This operation drops the last columns from this while they adhere to the predicate, stops as soon as it encounters one that does not, and collects the remaining columns 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, dropLastWhile is called dropLastColsWhile when called on a String or ColumnPath resembling a ColumnGroup.

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

Check out: Grammar

Examples:

df.select{ cols{ "my" init.name}.dropLastWhile{ "my" init.name} }

df.select{ myColumnGroup.dropLastWhile{ it.any{ it == "Alice" } } }

df.select{ "myColumnGroup".dropLastColsWhile{ it.kind() == ColumnKind.Value} }

Examples for this overload:

df.select{ Type::myColumnGroup.dropLastColsWhile{ it.name.startsWith("my") } }

df.select{ DataSchemaType::myColumnGroup.dropLastColsWhile{ it.any{ it == "Alice" } } }

See also:

  • drop — drops a fixed number of first columns.

  • dropLast — drops a fixed number of last columns.

  • dropWhile — drops the first columns while a predicate holds.

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

Return

A ColumnSet containing all columns except the last ones adhering to the predicate.

Parameters

predicate

The ColumnFilter to control which columns to drop.