melt to Go Long
Unpivoting columns into rows.
The Opposite of Pivot
When columns are really values in disguise, melt unpivots them into rows, turning a wide table into tidy long form. 🫠
What melt Produces
Melt creates two new columns: one holding the old column names, one holding their values. Every cell becomes its own row.
pd.melt(df)