DataFrame 1.0 Help

chunked

Splits a DataFrame into consecutive sub-dataframes (chunks) and returns them as a FrameColumn. Chunks are formed in order and do not overlap.

Each chunk contains at most the specified number of rows. The resulting FrameColumn ’s name can be customized; by default, it is "groups."

DataFrame can be split into chunks in two ways:

  • By fixed size: split into chunks of up to the given size.

  • By start indices: split using custom zero-based start indices for each chunk; each chunk ends right before the next start index or the end of the DataFrame.

df.chunked(size: Int, name: String) df.chunked(startIndices: List<Int>, name: String)

If called on a DataColumn, groups consecutive values of this column into lists of at most the given size and returns them as a ValueColumn of lists.

If called on a ColumnGroup (or on a DataColumn of rows), splits it into a FrameColumn of sub-dataframes with at most the given number of rows in each chunk. The resulting FrameColumn inherits the name of the group (or the column of rows).

column.chunked(size: Int) columnGroup.chunked(size: Int)

Examples

df

Fixed size chunks:

df.chunked(size = 2)

Custom start indices:

df.chunked(startIndices = listOf(0, 1, 3), name = "segments")
25 September 2026