Skip to main content
Session.read_pandas(
    dataframe: pd.DataFrame,
    /,
    *,
    data_types: Mapping[str, DataType] = frozendict({}),
    default_values: Mapping[str, Constant | None] = frozendict({}),
    keys: AbstractSet[str] | Sequence[str] = frozenset({}),
    partitioning: str | None = None,
    table_name: str,
) → Table
Read a pandas DataFrame into a table.
This is just a shortcut for:
The longer variant can be refactored to move the load() call inside a data_transaction().
All the named indices of the DataFrame are included into the table. Multilevel columns are flattened into a single string name.

Parameters

dataframe

The DataFrame to load.

data_types

Data types for some or all columns of the table. Data types for non specified columns will be inferred from the dataframe dtypes.

default_values

See create_table()’s default_values.

keys

See create_table()’s keys.

partitioning

See create_table()’s partitioning.

table_name

See create_table()’s name.