# Columnar export `agensgraph.columnar`. Each function imports its library only when called. See [DataFrames and Arrow](../../data/dataframes.md). ## Functions ```{py:currentmodule} agensgraph.columnar ``` ```{py:function} to_arrow(source: Any, keys: Sequence[str] | None = None, *, size: int | None = None, oids: Sequence[int] = (), layout: Layout = Layout(), schema: Any = None) -> Any A `pyarrow.Table`. `source` is a `Result`, a cursor, or rows with `keys`. ``` ```{py:function} to_pandas(source: Any, keys: Sequence[str] | None = None, *, dtypes: Literal['arrow', 'numpy'] = 'arrow', size: int | None = None, oids: Sequence[int] = (), layout: Layout = Layout(), schema: Any = None) -> Any A `pandas.DataFrame`, with Arrow types unless `dtypes="numpy"`. ``` ```{py:function} to_polars(source: Any, keys: Sequence[str] | None = None, *, size: int | None = None, oids: Sequence[int] = (), layout: Layout = Layout(), schema: Any = None) -> Any A `polars.DataFrame`. ``` ```{py:function} batches(source: Any, keys: Sequence[str] | None = None, *, size: int | None = 8192, oids: Sequence[int] = (), layout: Layout = Layout(), schema: Any = None) -> Iterator[Any] `pyarrow.RecordBatch`es of `size` rows; the first settles the schema. ``` ```{py:function} reader(source: Any, keys: Sequence[str] | None = None, *, size: int | None = 8192, oids: Sequence[int] = (), layout: Layout = Layout(), schema: Any = None) -> Any A `pyarrow.RecordBatchReader` over the same. ``` ```{py:function} columns(records: Sequence[Sequence[Any]], keys: Sequence[str]) -> dict[str, list[Any]] A `dict` of Python lists, without a library. ``` ```{py:function} async_to_arrow(source: Any, keys: Sequence[str] | None = None, *, size: int | None = None, oids: Sequence[int] = (), layout: Layout = Layout(), schema: Any = None) -> Any `to_arrow` for an awaiting source. ``` ```{py:function} async_to_pandas(source: Any, keys: Sequence[str] | None = None, *, dtypes: Literal['arrow', 'numpy'] = 'arrow', size: int | None = None, oids: Sequence[int] = (), layout: Layout = Layout(), schema: Any = None) -> Any `to_pandas` for an awaiting source. ``` ```{py:function} async_to_polars(source: Any, keys: Sequence[str] | None = None, *, size: int | None = None, oids: Sequence[int] = (), layout: Layout = Layout(), schema: Any = None) -> Any `to_polars` for an awaiting source. ``` ```{py:function} async_batches(source: Any, keys: Sequence[str] | None = None, *, size: int | None = 8192, oids: Sequence[int] = (), layout: Layout = Layout(), schema: Any = None) -> AsyncIterator[Any] `batches` for an awaiting source. ``` ## Layout ````{py:class} Layout(elements: Literal['struct', 'columns'] = 'struct', identity: Literal['packed', 'text'] = 'packed', properties: Any = 'json', labels: Literal['dictionary', 'text'] = 'dictionary', vectors: Literal['fixed', 'list'] = 'fixed', sparse: Literal['parts', 'text', 'dense'] = 'parts') How graph values become columns. ```{py:attribute} elements :type: Literal['struct', 'columns'] `struct`, or `columns` to spread an element over several ``` ```{py:attribute} identity :type: Literal['packed', 'text'] `packed` integers or `text` ``` ```{py:attribute} properties :type: Any `json` text, `skip`, or a `pyarrow` struct type of named properties ``` ```{py:attribute} labels :type: Literal['dictionary', 'text'] `dictionary` encoded or `text` ``` ```{py:attribute} vectors :type: Literal['fixed', 'list'] `fixed` size lists or variable `list`s ``` ```{py:attribute} sparse :type: Literal['parts', 'text', 'dense'] `parts`, `text` or `dense` ``` ```` ```{py:data} CHUNK :value: 8192 The default chunk size. ```