concat
Returns a DataColumn containing the values of this column followed by the values of other.
The columns in other are processed in argument order. The order within each column is preserved.
The result keeps the name of the first column. If there is only one input column, its runtime type is preserved.
When two or more columns contribute to one result column, the result keeps their shared runtime type, except for its nullability. If their runtime types differ, the result runtime type is inferred from the concatenated values. The result runtime type is nullable only if the resulting values contain null.
If all input columns are empty, their runtime types determine the result runtime type.
Empty columns add no values.
For more information: See concat on the documentation website.
See also Iterable.concat, which concatenates an iterable of columns.
Examples
peopleDf1.age.concat(peopleDf2.age)Return
A DataColumn with the same name as this column. It contains the values of this column followed by the values of each column in other in argument order.
Parameters
The columns whose values are appended to this column.
Type Parameters
The type of values in this DataColumn and the columns in other.
Returns a DataFrame containing the rows from every DataFrame stored in this column.
DataFrames are concatenated in the order in which they appear in the column. Row order within each DataFrame is preserved.
The result contains the union of the input schemas. Columns are ordered by their first appearance in the inputs. When two or more input schemas are combined, columns with the same name form one result column.
When two or more columns contribute to one result column, the result keeps their shared runtime type, except for its nullability. If their runtime types differ, the result runtime type is inferred from the concatenated values. The result runtime type is nullable only if the resulting values contain null.
If all input columns are empty, their runtime types determine the result runtime type.
When a value column is missing from an input that contributes rows, its values for those rows are filled with null, and its result runtime type becomes nullable.
Missing values in a List column are represented by empty lists, and missing values in a FrameColumn by empty DataFrames; these columns do not become nullable. A missing ColumnGroup remains a column group, and its nested columns are filled according to these same rules recursively.
An empty column of DataFrame type produces an empty DataFrame. A stored DataFrame with zero rows adds no rows, while its columns still participate in schema unification.
For more information: See concat on the documentation website.
See also:
Iterable.concat— concatenates an iterable ofDataFrames.DataFrame.concat— appendsDataFrames to a receiver.
Examples
val teamMembers = columnOf(
dataFrameOf(
"name" to columnOf("Alice", "Bob"),
"age" to columnOf(20, 15),
),
dataFrameOf("name", "age")("Charlie", 25),
)
teamMembers.concat()Return
A DataFrame containing all rows from the DataFrames stored in the DataColumn.
Type Parameters
The schema marker type of the DataFrames stored in this DataColumn.
Returns a List containing the elements of every Collection stored in this column.
Collections are processed in the order in which they appear in the column. Order within the collections is preserved. Empty collections add no elements.
For more information: See concat on the documentation website.
Examples
val nameGroups = columnOf<Collection<String>>(
listOf("Alice", "Bob"),
emptySet(),
setOf("Charlie"),
)
nameGroups.concat()Return
A List containing the concatenated elements of all collections stored in this DataColumn.
Type Parameters
The type of elements in the Collections stored in this DataColumn.
Returns a DataFrame containing this DataRow followed by rows.
Rows are processed in argument order.
The result contains the union of the input schemas. Columns are ordered by their first appearance in the inputs. When two or more input schemas are combined, columns with the same name form one result column.
When two or more columns contribute to one result column, the result keeps their shared runtime type, except for its nullability. If their runtime types differ, the result runtime type is inferred from the concatenated values. The result runtime type is nullable only if the resulting values contain null.
If a row does not contain a result value column, the corresponding value is null, and the result runtime type of that column becomes nullable.
Missing values in a List column are represented by empty lists, and missing values in a FrameColumn by empty DataFrames; these columns do not become nullable. A missing ColumnGroup remains a column group, and its nested columns are filled according to these same rules recursively.
For more information: See concat on the documentation website.
See also:
DataFrame.concat— appends an iterable of rows to aDataFrame.Iterable.concat— creates aDataFramefrom an iterable of nullable rows.
Examples
val youngest = df.minBy { age }
val oldest = df.maxBy { age }
youngest.concat(oldest)Return
A DataFrame containing this DataRow followed by rows in argument order.
Parameters
The rows to append to this DataRow.
Type Parameters
Returns a DataFrame containing the rows of this DataFrame followed by the rows of frames.
The DataFrames in frames are processed in argument order, and row order within every DataFrame is preserved. If no frames are supplied, the receiver is returned as the same DataFrame instance.
The result contains the union of the input schemas. Columns are ordered by their first appearance in the inputs. When two or more input schemas are combined, columns with the same name form one result column.
When two or more columns contribute to one result column, the result keeps their shared runtime type, except for its nullability. If their runtime types differ, the result runtime type is inferred from the concatenated values. The result runtime type is nullable only if the resulting values contain null.
If all input columns are empty, their runtime types determine the result runtime type.
When a value column is missing from an input that contributes rows, its values for those rows are filled with null, and its result runtime type becomes nullable.
Missing values in a List column are represented by empty lists, and missing values in a FrameColumn by empty DataFrames; these columns do not become nullable. A missing ColumnGroup remains a column group, and its nested columns are filled according to these same rules recursively.
A DataFrame supplied in frames with zero rows adds no rows, while its columns still participate in schema unification.
For more information: See concat on the documentation website.
See also Iterable.concat, which concatenates an iterable of DataFrames.
Examples
val firstBatch = dataFrameOf("name", "age", "city")("Bob", 15, "Paris")
val secondBatch = dataFrameOf("name", "age", "city")("Alice", 20, "London")
val thirdBatch = dataFrameOf("name", "age", "city")("Charlie", 25, "London")
firstBatch.concat(secondBatch, thirdBatch)Return
A DataFrame containing the rows of this DataFrame followed by the rows of each DataFrame in frames in argument order.
Parameters
Type Parameters
Returns a DataFrame containing the rows of this DataFrame followed by the rows of frame.
Row order within both DataFrames is preserved.
The result contains the union of the input schemas. Columns are ordered by their first appearance in the inputs. When two or more input schemas are combined, columns with the same name form one result column.
When two or more columns contribute to one result column, the result keeps their shared runtime type, except for its nullability. If their runtime types differ, the result runtime type is inferred from the concatenated values. The result runtime type is nullable only if the resulting values contain null.
If all input columns are empty, their runtime types determine the result runtime type.
When a value column is missing from an input that contributes rows, its values for those rows are filled with null, and its result runtime type becomes nullable.
Missing values in a List column are represented by empty lists, and missing values in a FrameColumn by empty DataFrames; these columns do not become nullable. A missing ColumnGroup remains a column group, and its nested columns are filled according to these same rules recursively.
If frame has zero rows, it adds no rows, while its columns still participate in schema unification.
For more information: See concat on the documentation website.
See also:
DataFrame.concat— otherDataFrameand row overloads.Iterable.concat— concatenates an iterable ofDataFrames.
Examples
peopleDf1 concat peopleDf2Return
A DataFrame with a schema that represents both input schemas. It contains the rows of this DataFrame followed by the rows of frame.
Parameters
Type Parameters
Returns a DataFrame containing the rows of this DataFrame followed by rows.
The rows from rows retain their iteration order.
The result contains the union of the input schemas. Columns are ordered by their first appearance in the inputs. When two or more input schemas are combined, columns with the same name form one result column.
When two or more columns contribute to one result column, the result keeps their shared runtime type, except for its nullability. If their runtime types differ, the result runtime type is inferred from the concatenated values. The result runtime type is nullable only if the resulting values contain null.
If a row does not contain a result value column, the corresponding value is null, and the result runtime type of that column becomes nullable.
Missing values in a List column are represented by empty lists, and missing values in a FrameColumn by empty DataFrames; these columns do not become nullable. A missing ColumnGroup remains a column group, and its nested columns are filled according to these same rules recursively.
If this DataFrame has no rows, its schema does not participate in schema unification. An empty rows iterable appends no rows.
For more information: See concat on the documentation website.
See also:
DataFrame.append— appends rows supplied as values.DataRow.concat— starts with aDataRow.Iterable.concat— creates aDataFramefrom an iterable of nullable rows.
Examples
val registeredPeople = dataFrameOf("name", "age", "city")("Alice", 20, "London")
val newPeople = dataFrameOf(
"name" to columnOf("Bob", "Charlie"),
"age" to columnOf(15, 25),
"city" to columnOf("Paris", "London"),
)
registeredPeople.concat(newPeople.rows())Return
A DataFrame containing the rows of this DataFrame followed by rows in iteration order.
Parameters
The rows to append to this DataFrame.
Type Parameters
Returns a DataFrame containing the rows of this DataFrame followed by the rows from frames.
The DataFrames in frames are concatenated in iteration order, and row order within every DataFrame is preserved.
The result contains the union of the input schemas. Columns are ordered by their first appearance in the inputs. When two or more input schemas are combined, columns with the same name form one result column.
When two or more columns contribute to one result column, the result keeps their shared runtime type, except for its nullability. If their runtime types differ, the result runtime type is inferred from the concatenated values. The result runtime type is nullable only if the resulting values contain null.
If all input columns are empty, their runtime types determine the result runtime type.
When a value column is missing from an input that contributes rows, its values for those rows are filled with null, and its result runtime type becomes nullable.
Missing values in a List column are represented by empty lists, and missing values in a FrameColumn by empty DataFrames; these columns do not become nullable. A missing ColumnGroup remains a column group, and its nested columns are filled according to these same rules recursively.
A DataFrame supplied in frames with zero rows adds no rows, while its columns still participate in schema unification.
If frames is empty, the receiver is returned as the same DataFrame instance.
For more information: See concat on the documentation website.
See also:
Iterable.concat— concatenates an iterable ofDataFrames.DataFrame.concat— otherDataFrameand row overloads.
Examples
val registeredPeople = dataFrameOf("name", "age", "city")("Bob", 15, "Paris")
val newPeople = listOf(
dataFrameOf("name", "age", "city")("Charlie", 25, "London"),
dataFrameOf("name", "age", "city")("Alice", 20, "London"),
)
registeredPeople.concat(newPeople)Return
A DataFrame containing the rows of this DataFrame followed by the rows from frames in iteration order.
Parameters
Type Parameters
Returns a DataFrame containing all groups in this GroupBy.
Groups are concatenated in the order in which they appear in groups, and row order within every group is preserved. The grouping keys stored in keys are not added to the result. If a group already contains a column with the same name as a key, that column is preserved unchanged.
Check out for more information.groupBy Grammar
For more information: See groupBy on the documentation website. See concat on the documentation website.
See also GroupBy.concatWithKeys, which adds grouping key columns that are missing from the groups.
Examples
val grouped = df.groupBy {
expr { if (age >= 20) "adult" else "teen" } named "ageGroup"
}
grouped.concat()Return
A DataFrame containing the rows from all groups, without any grouping key columns added.
Type Parameters
The schema marker type of the grouping keys.
The schema marker type of the groups.
Applies the stored reducer to every group and returns a DataFrame containing one resulting row per group, in the order in which the groups appear in the underlying GroupBy.
If the reduced rows have different schemas, the result contains the union of their schemas. Columns are ordered by their first appearance in the reduced rows. A value column missing from a reduced row is filled with null.
Missing values in a List column are represented by empty lists, and missing values in a FrameColumn by empty DataFrames; these columns do not become nullable. A missing ColumnGroup remains a column group, and its nested columns are filled according to these same rules recursively.
If the reducer returns null for a group, the result still contains one row for that group. This row is treated as missing every result column, so its values are filled according to the same rules.
For more information:
See groupBy on the documentation website.
See concat on the documentation website.
See also:
GroupBy.concat— concatenates the group rows without applying a reducer.GroupBy.concatWithKeys— also adds grouping keys that are missing from the groups.
Examples
df.groupBy { city }.first().concat()Return
A DataFrame containing one reduced row for every group.
Type Parameters
The schema marker type of the grouping keys in the underlying GroupBy.
The schema marker type of the groups and the resulting DataFrame.
Returns a DataFrame containing all rows from the DataFrames in this iterable.
The DataFrames are concatenated in iteration order, and row order within every DataFrame is preserved.
The result contains the union of the input schemas. Columns are ordered by their first appearance in the inputs. When two or more input schemas are combined, columns with the same name form one result column.
When two or more columns contribute to one result column, the result keeps their shared runtime type, except for its nullability. If their runtime types differ, the result runtime type is inferred from the concatenated values. The result runtime type is nullable only if the resulting values contain null.
If all input columns are empty, their runtime types determine the result runtime type.
When a value column is missing from an input that contributes rows, its values for those rows are filled with null, and its result runtime type becomes nullable.
Missing values in a List column are represented by empty lists, and missing values in a FrameColumn by empty DataFrames; these columns do not become nullable. A missing ColumnGroup remains a column group, and its nested columns are filled according to these same rules recursively.
A DataFrame with zero rows adds no rows, while its columns still participate in schema unification.
An empty iterable produces an empty DataFrame.
For more information: See concat on the documentation website.
See also:
DataFrame.concat— appendsDataFrames to a receiver.DataColumn.concat— concatenatesDataFrames stored in a column.
Examples
val batches = listOf(
dataFrameOf("name", "age", "city")("Charlie", 25, "London"),
dataFrameOf(
"name" to columnOf("Alice", "Bob"),
"age" to columnOf(20, 15),
"city" to columnOf("London", "Paris"),
),
)
batches.concat()Return
A DataFrame containing the rows of each input DataFrame in iteration order, or an empty DataFrame when this iterable is empty.
Type Parameters
The schema marker type of the DataFrames in this iterable.
Returns a DataColumn containing all values from the columns in this iterable.
The columns are concatenated in iteration order, and value order within every column is preserved.
The result keeps the name of the first column. If there is only one input column, its runtime type is preserved.
When two or more columns contribute to one result column, the result keeps their shared runtime type, except for its nullability. If their runtime types differ, the result runtime type is inferred from the concatenated values. The result runtime type is nullable only if the resulting values contain null.
If all input columns are empty, their runtime types determine the result runtime type.
An empty iterable produces an empty column.
For more information: See concat on the documentation website.
See also DataColumn.concat, which appends columns to a receiver DataColumn.
Examples
val ageColumns = listOf(
columnOf(20, 25).named("age"),
columnOf(15).named("additionalAges"),
)
ageColumns.concat()Return
A DataColumn containing the concatenated values, or an empty DataColumn when this iterable is empty.
Type Parameters
The type of values in the DataColumns in this iterable.
Returns a DataFrame containing the rows in this iterable in iteration order.
The result contains the union of the input schemas. Columns are ordered by their first appearance in the inputs. When two or more input schemas are combined, columns with the same name form one result column.
When two or more columns contribute to one result column, the result keeps their shared runtime type, except for its nullability. If their runtime types differ, the result runtime type is inferred from the concatenated values. The result runtime type is nullable only if the resulting values contain null.
If a row does not contain a result value column, the corresponding value is null, and the result runtime type of that column becomes nullable.
Missing values in a List column are represented by empty lists, and missing values in a FrameColumn by empty DataFrames; these columns do not become nullable. A missing ColumnGroup remains a column group, and its nested columns are filled according to these same rules recursively.
A null element of this iterable contributes one result row. Its values are filled according to the missing-column rules above. An empty iterable produces an empty DataFrame.
For more information: See concat on the documentation website.
See also:
DataRow.concat— starts with oneDataRow.DataFrame.concat— appends an iterable of rows to aDataFrame.
Examples
val rows = listOf(df[0], null, df[1])
rows.concat()Return
A DataFrame containing every row in iteration order. Each null element of this iterable contributes one result row whose values follow the missing-column rules above.
Type Parameters
The schema marker type of the non-null DataRows in this iterable.