> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Session.read_pandas()

> Session.read\_pandas(\
>
>     *dataframe*: pd.DataFrame,\
>
>     /,\
>
>     \*,\
>
>     *data\_types*: Mapping\[[str](https://docs.python.org/3/builtins/stdtypes.html#str), DataType] = `frozendict({})`,\
>
>     *default\_values*: Mapping\[[str](https://docs.python.org/3/builtins/stdtypes.html#str), Constant | [None](https://docs.python.org/3/builtins/constants.html#None)] = `frozendict({})`,\
>
>     *keys*: AbstractSet\[[str](https://docs.python.org/3/builtins/stdtypes.html#str)] | Sequence\[[str](https://docs.python.org/3/builtins/stdtypes.html#str)] = `frozenset({})`,\
>
>     *partitioning*: [str](https://docs.python.org/3/builtins/stdtypes.html#str) | [None](https://docs.python.org/3/builtins/constants.html#None) = `None`,\
>
>     *table\_name*: [str](https://docs.python.org/3/builtins/stdtypes.html#str),\
>
> ) → [Table](./atoti.Table#atoti.Table)

Read a pandas DataFrame into a table.

> [!NOTE]
>
> This is just a shortcut for:
>
> ```python theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
> inferred_data_types = session.tables.infer_data_types(dataframe)
> table = session.create_table(
>     table_name,
>     data_types={**inferred_data_types, **data_types},
>     default_values=...,
>     keys=...,
>     partitioning=...,
> )
> table.load(dataframe)
> ```
>
> The longer variant can be refactored to move the [`load()`](./atoti.Table.load#atoti.Table.load) call inside a [`data_transaction()`](./atoti.Tables.data_transaction#atoti.tables.Tables.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()`](./atoti.Session.create_table#atoti.Session.create_table)’s *default\_values*.

#### *keys*

See [`create_table()`](./atoti.Session.create_table#atoti.Session.create_table)’s *keys*.

#### *partitioning*

See [`create_table()`](./atoti.Session.create_table#atoti.Session.create_table)’s *partitioning*.

#### *table\_name*

See [`create_table()`](./atoti.Session.create_table#atoti.Session.create_table)’s *name*.
