chunked

fun <T> DataFrame<T>.chunked(size: Int, name: String = "groups"): FrameColumn<T>

Splits this DataFrame into consecutive chunks of up to size rows and returns them as a FrameColumn.

Each element of the resulting FrameColumn is a sub-DataFrame containing at most size rows. Chunks are formed in order, without overlap.

For more information: See chunked on the documentation website.

Return

A FrameColumn where each value is a sub-DataFrame chunk.

Parameters

size

Maximum number of rows in each chunk. Must be positive.

name

Name of the resulting FrameColumn. Defaults to "groups".


fun <T> DataFrame<T>.chunked(startIndices: Iterable<Int>, name: String = "groups"): FrameColumn<T>

Splits this DataFrame into chunks starting at the given startIndices.

The chunk starting at index i ends right before the next start index or the end of the DataFrame. Use this overload when you need custom chunk boundaries.

For more information: See chunked on the documentation website.

Return

A FrameColumn where each value is a sub-DataFrame chunk.

Parameters

startIndices

Zero-based row indices where each new chunk starts.

name

Name of the resulting FrameColumn. Defaults to "groups".


Groups consecutive values of this DataColumn into lists of at most size elements.

This works like kotlin.collections.chunked, but returns a ValueColumn instead of a List.

For more information: See chunked on the documentation website.

Return

A ValueColumn whose elements are lists representing chunks of the original values.

Parameters

size

Maximum number of elements in each chunk. Must be positive.


Splits this ColumnGroup into a FrameColumn of sub-dataframes with up to size rows in each chunk.

The resulting FrameColumn inherits the name of this group.

For more information: See chunked on the documentation website.

Return

A FrameColumn where each value is a sub-DataFrame chunk.

Parameters

size

Maximum number of rows in each sub-dataframe. Must be positive.


Splits a DataColumn of DataRow into a FrameColumn of sub-dataframes with up to size rows in each chunk.

This is a convenience overload that treats a DataColumn of rows as if it were a ColumnGroup (see ColumnGroup.chunked).

For more information: See chunked on the documentation website.

Return

A FrameColumn where each value is a sub-DataFrame chunk.

Parameters

size

Maximum number of rows in each sub-dataframe. Must be positive.