Command
df.pivotExplanation
df.pivot() reshapes long-format data back into wide format.
Examples
Pivot long-format data into wide-format
df.pivot(index="id", columns="variable", values="value")df.pivotdf.pivot() reshapes long-format data back into wide format.
Pivot long-format data into wide-format
df.pivot(index="id", columns="variable", values="value")