Community Python Snippet
Pandas Melt-Then-Pivot: The Shape I Always Need
I keep reaching for melt-then-pivot to reshape wide tables for charting. Here is the pandas-style transform written in pure stdlib Python so it runs anywhere, plus the multi-key pivot variant.
