pandas.DataFrame.from_dict

pandas 3.1.1 · DataFrame · method

Build a DataFrame from a mapping of columns or rows.

Call syntax

DataFrame.from_dict(data, orient='columns', dtype=None, columns=None)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
data Required
Positional or keyword
dict

Provide the input data read, transformed, or stored by this call.

orient Optional
Positional or keyword
Default 'columns'
{'columns', 'index', 'tight'}

Choose how row labels, columns, and values are arranged in the serialized result.

dtype Optional
Positional or keyword
Default None
dtype

Choose the data type for the input conversion or result.

columns Optional
Positional or keyword
Default None
list

Supply column labels or control how columns are handled.

Returns

DataFrame