colsOf
Cols Of
Returns a ColumnSet of columns from this that are a subtype of the given type C, optionally filtered by filter.
This function operates solely on columns at the top-level.
NOTE: Null-filled columns of type Nothing? will be included when selecting colsOf<T?>(). This is because Nothing is considered a subtype of all other types in Kotlin. To exclude these columns, call .filter{ !it.allNulls() } after it.
For more information: See colsOf on the documentation website.
Check out: Grammar
For example:
df.select{ colsOf<Int> { it.size> 10 } }
Alternatively, colsOf can also be called on existing columns:
df.select{ myColumnGroup.colsOf<Int>() }
df.select{ "myColumnGroup"<Type>().colsOf<Int> { it.size> 10 } }
df.select{ Type::myColumnGroup.colsOf<Double>() }
Finally, colsOf can also take a KType argument instead of a reified type. This is useful when the type is not known at compile time or when the API function cannot be inlined.
df.select{ colsOf<Int>(typeOf<Int>()) }
df.select{ "myColumnGroup".colsOf<Int>(typeOf<Int>()) { it: DataColumn<Int> -> it.size> 10 } }
Examples for this overload:
df.select{ "myColumnGroup".colsOf(typeOf<Int>()) }
df.select{ "myColumnGroup".colsOf(typeOf<Int>()) { it: DataColumn<Int> -> it.size> 10 } }
Return
A ColumnSet containing the columns of given type that were included by filter.
Parameters
an optional filter function that takes a column of type C and returns true if the column should be included.
Cols Of
Returns a ColumnSet of columns from this that are a subtype of the given type C, optionally filtered by filter.
This function operates solely on columns at the top-level.
NOTE: Null-filled columns of type Nothing? will be included when selecting colsOf<T?>(). This is because Nothing is considered a subtype of all other types in Kotlin. To exclude these columns, call .filter{ !it.allNulls() } after it.
For more information: See colsOf on the documentation website.
Check out: Grammar
For example:
df.select{ colsOf<Int> { it.size> 10 } }
Alternatively, colsOf can also be called on existing columns:
df.select{ myColumnGroup.colsOf<Int>() }
df.select{ "myColumnGroup"<Type>().colsOf<Int> { it.size> 10 } }
df.select{ Type::myColumnGroup.colsOf<Double>() }
Finally, colsOf can also take a KType argument instead of a reified type. This is useful when the type is not known at compile time or when the API function cannot be inlined.
df.select{ colsOf<Int>(typeOf<Int>()) }
df.select{ "myColumnGroup".colsOf<Int>(typeOf<Int>()) { it: DataColumn<Int> -> it.size> 10 } }
Examples for this overload:
df.select{ "pathTo"["myColumnGroup"].colsOf(typeOf<Int>()) }
df.select{ "pathTo"["myColumnGroup"].colsOf(typeOf<Int>()) { it: DataColumn<Int> -> it.size> 10 } }
Return
A ColumnSet containing the columns of given type that were included by filter.
Parameters
an optional filter function that takes a column of type C and returns true if the column should be included.
Deprecated
It's recommended to migrate to the String or Extension Properties Access API https://kotlin.github.io/dataframe/apilevels.html
Cols Of
Returns a ColumnSet of columns from this that are a subtype of the given type C, optionally filtered by filter.
This function operates solely on columns at the top-level.
NOTE: Null-filled columns of type Nothing? will be included when selecting colsOf<T?>(). This is because Nothing is considered a subtype of all other types in Kotlin. To exclude these columns, call .filter{ !it.allNulls() } after it.
For more information: See colsOf on the documentation website.
Check out: Grammar
For example:
df.select{ colsOf<Int> { it.size> 10 } }
Alternatively, colsOf can also be called on existing columns:
df.select{ myColumnGroup.colsOf<Int>() }
df.select{ "myColumnGroup"<Type>().colsOf<Int> { it.size> 10 } }
df.select{ Type::myColumnGroup.colsOf<Double>() }
Finally, colsOf can also take a KType argument instead of a reified type. This is useful when the type is not known at compile time or when the API function cannot be inlined.
df.select{ colsOf<Int>(typeOf<Int>()) }
df.select{ "myColumnGroup".colsOf<Int>(typeOf<Int>()) { it: DataColumn<Int> -> it.size> 10 } }
Examples for this overload:
df.select{ DataSchemaType::myColumnGroup.colsOf(typeOf<Int>()) }
df.select{ Type::myColumnGroup.colsOf(typeOf<Int>()) { it: DataColumn<Int> -> it.size> 10 } }
Return
A ColumnSet containing the columns of given type that were included by filter.
Parameters
an optional filter function that takes a column of type C and returns true if the column should be included.