ds_provider_xledger_py_lib.utils.dataframe¶
File: dataframe.py
Region: ds_provider_xledger_py_lib/utils
Description¶
Small dataframe helpers shared by serializer and deserializer.
Functions¶
|
Convert dataframe rows to JSON-safe records with |
|
Flatten |
Module Contents¶
- ds_provider_xledger_py_lib.utils.dataframe.dataframe_to_records(df: pandas.DataFrame) list[dict[str, Any]][source]¶
Convert dataframe rows to JSON-safe records with
Nonefor nulls.- Parameters:
df – Input dataframe.
- Returns:
List of row dictionaries.
- ds_provider_xledger_py_lib.utils.dataframe.edges_to_dataframe(*, edges: list[dict[str, Any]], columns: list[str] | None = None) pandas.DataFrame[source]¶
Flatten
edges[].nodepayload into a dataframe.- Parameters:
edges – GraphQL connection edges.
columns – Optional explicit column order/filter.
- Returns:
Flattened dataframe.