PivotDsl
A specialized ColumnsSelectionDsl that allows specifying pivot key ordering using the then function.
PivotDsl defines how key columns are selected and structured in a pivot:
pivotwith a single key column produces aPivotcontaining one column for each unique key (i.e., key column unique values) with the corresponding group;pivotwith multiple keys combined usingandproduces aPivotwith independentcolumn groupsfor each key column, each having subcolumns with the keys corresponding to their unique values;pivotwith multiple keys ordered usingthenproduces aPivotwith nestedcolumn groups, representing a hierarchical structure of keys combinations from the pivoted columns — i.e., one group per unique key combination.
Examples
// Pivot by the "city" column
df.pivot { city }
// Independent pivot by "city" and "lastName" (from the "name" column group)
df.pivot { city and name.lastName }
// Hierarchical pivot by two columns with composite ("city", "lastName") keys
df.pivot { city then name.lastName }Properties
Accesses the 'key' column of this KeyValueProperty ColumnsContainer.
Functions
Creates a new ColumnSet that contains a subset of columns from this, containing all columns after column, excluding column itself.
Creates a new ColumnSet that contains a subset of columns from this, containing all columns after column, excluding column itself.
Creates a new ColumnSet that contains a subset of columns from this, containing all columns before column, excluding column itself.
Creates a new ColumnSet that contains a subset of columns from this, containing all columns before column, excluding column itself.
Exclude a selection of columns from the current selection using the Columns Selection DSL.
Creates a new ColumnSet that contains a subset of columns from this, containing all columns from column, including column itself.
Creates a new ColumnSet that contains a subset of columns from this, containing all columns from column, including column itself.
Creates a new ColumnSet that contains a subset of columns from this, containing all columns up to column, including column itself.
Creates a new ColumnSet that contains a subset of columns from this, containing all columns up to column, including column itself.
Exclude a selection of columns from the current selection using the Columns Selection DSL.
The and operator allows you to combine selections of columns or simply select multiple columns at once.
Creates a ColumnAccessor (or SingleColumn) for a column with the given argument which can be either an index (Int) or a reference to a column (String, ColumnPath, KProperty, or ColumnAccessor; any Access APIs).
Creates a ColumnAccessor (or SingleColumn) for a column group with the given argument which can be either an index (Int) or a reference to a column (String, ColumnPath, KProperty, or ColumnAccessor; any Access APIs).
Creates a subset of columns from this that are ColumnGroups.
Creates a subset of columns from this that are ColumnGroups.
Creates a subset of columns from this that are ColumnGroups.
Creates a subset of columns from this that are ColumnGroups.
Creates a subset of columns from this that are ColumnGroups.
Creates a subset of columns from this that are ColumnGroups.
Retrieves multiple columns from this in the form of a ColumnSet by a range of indices. If any of the indices in the range are out of bounds, an IndexOutOfBoundsException is thrown.
Retrieves multiple columns from this in the form of a ColumnSet by a range of indices. If any of the indices in the range are out of bounds, an IndexOutOfBoundsException is thrown.
Retrieves multiple columns from this in the form of a ColumnSet by a range of indices. If any of the indices in the range are out of bounds, an IndexOutOfBoundsException is thrown.
Retrieves multiple columns from this in the form of a ColumnSet by a range of indices. If any of the indices in the range are out of bounds, an IndexOutOfBoundsException is thrown.
Retrieves multiple columns from this in the form of a ColumnSet by a range of indices. If any of the indices in the range are out of bounds, an IndexOutOfBoundsException is thrown.
Retrieves multiple columns from this in the form of a ColumnSet by a range of indices. If any of the indices in the range are out of bounds, an IndexOutOfBoundsException is thrown.
Retrieves one or multiple columns from this in the form of a ColumnSet by their indices. If any of the indices are out of bounds, an IndexOutOfBoundsException is thrown.
Retrieves one or multiple columns from this in the form of a ColumnSet by their indices. If any of the indices are out of bounds, an IndexOutOfBoundsException is thrown.
Retrieves one or multiple columns from this in the form of a ColumnSet by their indices. If any of the indices are out of bounds, an IndexOutOfBoundsException is thrown.
Retrieves one or multiple columns from this in the form of a ColumnSet by their indices. If any of the indices are out of bounds, an IndexOutOfBoundsException is thrown.
Retrieves one or multiple columns from this in the form of a ColumnSet by their indices. If any of the indices are out of bounds, an IndexOutOfBoundsException is thrown.
Retrieves one or multiple columns from this in the form of a ColumnSet by their indices. If any of the indices are out of bounds, an IndexOutOfBoundsException is thrown.
Returns all columns in this at any depth (so also inside Column Groups)
Returns all columns in this at any depth (so also inside Column Groups)
Returns all columns in this at any depth (so also inside Column Groups)
Returns all columns in this at any depth (so also inside Column Groups)
Returns all columns in this at any depth (so also inside Column Groups)
Returns all columns in this at any depth (so also inside Column Groups)
colsInGroups is a function that returns all columns at the top-levels of all column groups in this. This is useful if you want to select all columns that are "one level deeper".
colsInGroups is a function that returns all columns at the top-levels of all column groups in this. This is useful if you want to select all columns that are "one level deeper".
colsInGroups is a function that returns all columns at the top-levels of all column groups in this. This is useful if you want to select all columns that are "one level deeper".
colsInGroups is a function that returns all columns at the top-levels of all column groups in this. This is useful if you want to select all columns that are "one level deeper".
colsInGroups is a function that returns all columns at the top-levels of all column groups in this. This is useful if you want to select all columns that are "one level deeper".
colsInGroups is a function that returns all columns at the top-levels of all column groups in this. This is useful if you want to select all columns that are "one level deeper".
Returns a ColumnSet of columns from this that are a subtype of the given type C, optionally filtered by filter.
Returns a ColumnSet of columns from this that are a subtype of the given type C, optionally filtered by filter.
Creates a subset of columns from this that are of the given kind(s).
Creates a subset of columns from this that are of the given kind(s).
Creates a subset of columns from this that are of the given kind(s).
Creates a subset of columns from this that are of the given kind(s).
Creates a subset of columns from this that are of the given kind(s).
Creates a subset of columns from this that are of the given kind(s).
Exclude a selection of columns from the current selection using the Columns Selection DSL.
Creates a temporary new column by defining an expression to fill up each row.
Returns the first column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.
Returns the first column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.
Returns the first column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.
Returns the first column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.
Returns the first column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.
Returns the first column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.
Creates a ColumnAccessor (or SingleColumn) for a frame column with the given argument which can be either an index (Int) or a reference to a column (String, ColumnPath, KProperty, or ColumnAccessor; any Access APIs).
Creates a subset of columns from this that are FrameColumns.
Creates a subset of columns from this that are FrameColumns.
Creates a subset of columns from this that are FrameColumns.
Creates a subset of columns from this that are FrameColumns.
Creates a subset of columns from this that are FrameColumns.
Creates a subset of columns from this that are FrameColumns.
Creates a ColumnAccessor (or SingleColumn) for a column with the given argument which can be either an index (Int) or a reference to a column (String, ColumnPath, KProperty, or ColumnAccessor; any Access APIs).
Retrieves multiple columns from this in the form of a ColumnSet by a range of indices. If any of the indices in the range are out of bounds, an IndexOutOfBoundsException is thrown.
Retrieves one or multiple columns from this in the form of a ColumnSet by their indices. If any of the indices are out of bounds, an IndexOutOfBoundsException is thrown.
Creates a ColumnPath from the receiver and the given column name column. This is a shorthand for pathOf("myColumnName", "myNestedColumnName") and is often used in combination with ColumnPath.invoke to retrieve the value of a nested column. For instance:
Retrieves the value of this KProperty Accessor from the DataFrame.
As extension to "myColumn"["myNestedColumn"], this function enables "myColumn"["myNestedColumn"]["myDoublyNestedColumn"] as alternative to pathOf("myColumn", "myNestedColumn", "myDoublyNestedColumn")
Renaming a column in the ColumnsSelectionDsl is done by calling the infix functions named or into. They behave exactly the same, so it's up to contextual preference which one to use. Any combination of Access APIs can be used to specify the column to rename and which name should be used instead.
Retrieves the value of the column with this name from the DataFrame. This can be both typed and untyped. This is a shorthand for get("myColumnName") and can be written as "myColumnName"<MyColumnType>() instead.
Retrieves the value of the column with this name from the DataFrame. This can be both typed and untyped. This is a shorthand for get("myColumnName") and can be written as "myColumnName"() instead.
Retrieves the value of this KProperty Accessor from the DataFrame.
Retrieves the value of this ColumnPath from the DataFrame. This is a shorthand for getColumn(myColumnPath) and is most often used in combination with operator fun String.get(column: String), for instance:
Retrieves the value of this ColumnReference or -Accessor from the DataFrame.
Invokes the given ColumnsSelector using this ColumnsSelectionDsl.
Perform a selection of columns using the Columns Selection DSL on any ColumnGroup. This is more powerful than the cols filter, because now all operations of the DSL are at your disposal.
Returns the last column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.
Returns the last column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.
Returns the last column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.
Returns the last column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.
Returns the last column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.
Returns the last column from this that adheres to the optional given condition. If no column adheres to the given condition, NoSuchElementException is thrown.
Returns a new DataColumn with the given name and the values that body computes from the rows of this ColumnsContainer.
Renaming a column in the ColumnsSelectionDsl is done by calling the infix functions named or into. They behave exactly the same, so it's up to contextual preference which one to use. Any combination of Access APIs can be used to specify the column to rename and which name should be used instead.
Creates an empty ColumnsResolver / ColumnSet, essentially selecting no columns at all.
Creates a ColumnSet containing all columns from this up to (and including) endInclusive.
Creates a ColumnSet containing all columns from this up to (and including) endInclusive.
Creates a ColumnSet containing all columns from this up to (and including) endInclusive.
Perform a selection of columns using the Columns Selection DSL on any ColumnGroup. This is more powerful than the cols filter, because now all operations of the DSL are at your disposal.
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
Returns the single column from this. If there is no column, NoSuchElementException is thrown. If there are multiple columns, IllegalArgumentException is thrown.
Specifies the ordering of the pivot key columns.
Creates a ColumnAccessor (or SingleColumn) for a value column with the given argument which can be either an index (Int) or a reference to a column (String, ColumnPath, KProperty, or ColumnAccessor; any Access APIs).
Creates a subset of columns from this that are ValueColumns.
Creates a subset of columns from this that are ValueColumns.
Creates a subset of columns from this that are ValueColumns.
Creates a subset of columns from this that are ValueColumns.
Creates a subset of columns from this that are ValueColumns.
Creates a subset of columns from this that are ValueColumns.