Unstack

The unstack operation is the inverse of stack, reshaping a long-format dataset into a wide-format dataset.
Example
Dataset:
Country | Attribute | Value |
---|---|---|
USA | Population | 330000000 |
USA | GDP | 21000000 |
China | Population | 1400000000 |
China | GDP | 15000000 |
India | Population | 1350000000 |
India | GDP | 3000000 |
Unstack the dataset:
Country | Population | GDP |
---|---|---|
USA | 330000000 | 21000000 |
China | 1400000000 | 15000000 |
India | 1350000000 | 3000000 |
Updated 5 months ago