pandas_ts.utils

Module Contents

Functions

is_pa_type_a_list(→ bool)

Check if the given pyarrow type is a list type.

enumerate_chunks(...)

Iterate over pyarrow.ChunkedArray chunks with their slice indices.

is_pa_type_a_list(pa_type: type[pyarrow.Array]) bool[source]

Check if the given pyarrow type is a list type.

I.e. one of the following types: ListArray, LargeListArray, FixedSizeListArray.

Returns:

True if the given type is a list type, False otherwise.

Return type:

bool

enumerate_chunks(array: pyarrow.ChunkedArray) collections.abc.Generator[tuple[slice, pyarrow.Array], None, None][source]

Iterate over pyarrow.ChunkedArray chunks with their slice indices.

Parameters:

array (pa.ChunkedArray) – Input chunked array.

Yields:
  • sliceslice(index_start, index_stop) for the current chunk.

  • pa.Array – The current chunk.