AI engineering glossary · NumPy pandas visualization

What is unstack?

unstack (also called stack): A pandas method that moves an inner level of a row index into the column headers, turning a long, stacked layout into a wider table. Its inverse, stack, moves column labels into the row index. Both work on a MultiIndex.

Level: advancedTopic: NumPy pandas visualization

unstack: an example

A series indexed by (city, month) becomes a table with cities as rows and months as columns after s.unstack().

Related terms

More NumPy pandas visualization terms

Where you learn it

unstack is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.