pandas.DataFrame.explode

pandas 3.1.1 · DataFrame · method

Expand list-like cells into rows, repeating original row labels as needed.

Call syntax

DataFrame.explode(column, ignore_index=False)

Run the example

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

Parameters

ParameterRequirementAccepted values and behavior
column Required
Positional or keyword
IndexLabel

Identify the column or columns to use.

ignore_index Optional
Positional or keyword
Default False
bool

Give the resulting axis new integer labels where supported.

Returns

DataFrame