Skip to content

DataRecord

A DataRecord is a single record of data matching some Schema.

from_df staticmethod

from_df(df: DataFrame, schema: Schema | None = None) -> list[DataRecord]

Create a list of DataRecords from a pandas DataFrame

Parameters:

  • df (DataFrame) –

    Input DataFrame

  • schema (Schema, default: None ) –

    Schema for the DataRecords. If None, will be derived from DataFrame

Returns:

  • list[DataRecord]

    list[DataRecord]: List of DataRecord instances

to_dict

to_dict(
    include_bytes: bool = True,
    bytes_to_str: bool = False,
    project_cols: list[str] | None = None,
)

Return a dictionary representation of this DataRecord

to_json_str

to_json_str(
    include_bytes: bool = True,
    bytes_to_str: bool = False,
    project_cols: list[str] | None = None,
)

Return a JSON representation of this DataRecord