Dataframe 0.14 Help

concat

Returns a DataFrame with the union of rows from several given DataFrame objects.

concat is available for:

DataFrame:

df.concat(df1, df2)

DataColumn:

val a by columnOf(1, 2) val b by columnOf(3, 4) a.concat(b)

Iterable<DataFrame>:

listOf(df1, df2).concat()

Iterable<DataRow>:

val rows = listOf(df[2], df[4], df[5]) rows.concat()

Iterable<DataColumn>:

val a by columnOf(1, 2) val b by columnOf(3, 4) listOf(a, b).concat()

groupBy:

df.groupBy { name }.concat()

FrameColumn:

val x = dataFrameOf("a", "b")( 1, 2, 3, 4, ) val y = dataFrameOf("b", "c")( 5, 6, 7, 8, ) val frameColumn by columnOf(x, y) frameColumn.concat()

If you want to take the union of columns (not rows) from several DataFrame objects, see add.

Schema unification

If input DataFrame objects have different schemas, every column in the resulting DataFrame will get the lowest common type of the original columns with the same name.

For example, if one DataFrame has a column A: Int and another DataFrame has a column A: Double, the resulting DataFrame will have a column A: Number.

Missing columns in DataFrame objects will be filled with null.

Last modified: 27 September 2024