ds_provider_xledger_py_lib.utils.dataframe ========================================== .. py:module:: ds_provider_xledger_py_lib.utils.dataframe .. autoapi-nested-parse:: **File:** ``dataframe.py`` **Region:** ``ds_provider_xledger_py_lib/utils`` Description ----------- Small dataframe helpers shared by serializer and deserializer. Functions --------- .. autoapisummary:: ds_provider_xledger_py_lib.utils.dataframe.dataframe_to_records ds_provider_xledger_py_lib.utils.dataframe.edges_to_dataframe Module Contents --------------- .. py:function:: dataframe_to_records(df: pandas.DataFrame) -> list[dict[str, Any]] Convert dataframe rows to JSON-safe records with ``None`` for nulls. :param df: Input dataframe. :returns: List of row dictionaries. .. py:function:: edges_to_dataframe(*, edges: list[dict[str, Any]], columns: list[str] | None = None) -> pandas.DataFrame Flatten ``edges[].node`` payload into a dataframe. :param edges: GraphQL connection edges. :param columns: Optional explicit column order/filter. :returns: Flattened dataframe.