ChunkDf#

class caf.toolkit.pandas_utils.ChunkDf(df, chunk_size)[source]#

Generator to split a dataframe into chunks.

Similar to chunk_df(), but validates the input arguments and throws and error if not valid.

Parameters:
  • df (pd.DataFrame) – the pandas.DataFrame to chunk.

  • chunk_size (int) – The size of the chunks to use, in terms of rows.

Raises:
  • ValueError: – If chunk_size is less than or equal to 0. Or if it is not and integer value.

  • TypeError: – If chunk_size is not and integer

See also

caf.toolkit.pandas_utils.chunk_df()

Methods

__init__(df, chunk_size)