chunk

method of dascore.core.spool.ChunkManager source

chunk(
    self ,
    df: DataFrame ,
)-> tuple[DataFrame, DataFrame]

Chunk a dataframe into new contiguous segments.

The dataframe must have column names {key}_max, {key}min, and d{key} where {key} is the key used in the kwargs.

Parameters

Parameter Description
df Input dataframe to chunk.

Returns

A tuple of the original dataframe with added column ’_group’ and an output dataframe with column ’_group’. The _group column is used to link the two dataframes together.