singleCol
Single (Col)
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
This function operates solely on columns at the top-level.
NOTE: For column groups, single is named singleCol instead to avoid confusion.
For more information: See First (Col), Last (Col), Single (Col) on the documentation website.
Check out: Grammar
Examples:
df.select{ nameStartsWith("order").single() }
df.select{ "myColumnGroup".colsNameStartsWith("order").singleCol() }
Examples for this overload:
df.select{ myColumnGroup.singleCol() }
Return
A SingleColumn containing the single column.
Throws
Single (Col)
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
This function operates solely on columns at the top-level.
NOTE: For column groups, single is named singleCol instead to avoid confusion.
For more information: See First (Col), Last (Col), Single (Col) on the documentation website.
Check out: Grammar
Examples:
df.select{ nameStartsWith("order").single() }
df.select{ "myColumnGroup".colsNameStartsWith("order").singleCol() }
Examples for this overload:
df.select{ "myColumnGroup".colsNameStartsWith("year").singleCol() }
Return
A SingleColumn containing the single column.
Throws
Single (Col)
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
This function operates solely on columns at the top-level.
NOTE: For column groups, single is named singleCol instead to avoid confusion.
For more information: See First (Col), Last (Col), Single (Col) on the documentation website.
Check out: Grammar
Examples:
df.select{ nameStartsWith("order").single() }
df.select{ "myColumnGroup".colsNameStartsWith("order").singleCol() }
Examples for this overload:
df.select{ "pathTo"["myColumnGroup"].singleCol{ it.name().startsWith("year") } }
Return
A SingleColumn containing the single column.
Throws
Deprecated
Deprecated shortcut for better compiler plugin support. Will be ERROR in 1.1.
Replace with
this.allCols().filter(condition).single()Single (Col)
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
This function operates solely on columns at the top-level.
NOTE: For column groups, single is named singleCol instead to avoid confusion.
For more information: See First (Col), Last (Col), Single (Col) on the documentation website.
Check out: Grammar
Examples:
df.select{ nameStartsWith("order").single() }
df.select{ "myColumnGroup".colsNameStartsWith("order").singleCol() }
Examples for this overload:
df.select{ myColumnGroup.singleCol() }
Return
A SingleColumn containing the single column.
Throws
Deprecated
Deprecated shortcut for better compiler plugin support. Will be ERROR in 1.1.
Replace with
this.allCols().filter(condition).single()Single (Col)
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
This function operates solely on columns at the top-level.
NOTE: For column groups, single is named singleCol instead to avoid confusion.
For more information: See First (Col), Last (Col), Single (Col) on the documentation website.
Check out: Grammar
Examples:
df.select{ nameStartsWith("order").single() }
df.select{ "myColumnGroup".colsNameStartsWith("order").singleCol() }
Examples for this overload:
df.select{ "myColumnGroup".singleCol{ it.name().startsWith("year") } }
Return
A SingleColumn containing the single column.
Throws
Deprecated
It's recommended to migrate to the String or Extension Properties Access API https://kotlin.github.io/dataframe/apilevels.html
Single (Col)
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
This function operates solely on columns at the top-level.
NOTE: For column groups, single is named singleCol instead to avoid confusion.
For more information: See First (Col), Last (Col), Single (Col) on the documentation website.
Check out: Grammar
Examples:
df.select{ nameStartsWith("order").single() }
df.select{ "myColumnGroup".colsNameStartsWith("order").singleCol() }
Examples for this overload:
df.select{ Type::myColumnGroup.singleCol{ it.name().startsWith("year") } }
df.select{ DataSchemaType::myColumnGroup.singleCol() }
Return
A SingleColumn containing the single column.