pandas.lreshape

pandas 3.1.1 · General functions · function

Move groups of equally sized wide columns into aligned long-form columns.

Call syntax

pd.lreshape(data, groups, dropna=True)

Run the example

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

Parameters

ParameterRequirementAccepted values and behavior
data Required
Positional or keyword
DataFrame

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

groups Required
Positional or keyword
dict
dropna Optional
Positional or keyword
Default True
bool

Choose whether to drop missing values or missing keys from consideration.

Returns

DataFrame