The stack operation pivots a wide-format dataset into a long-format dataset by converting column headers into row values in a new column.

Example

Dataset:

CountryPopulationGDP
USA33000000021000000
China140000000015000000
India13500000003000000

Stack the dataset:

CountryAttributeValue
USAPopulation330000000
USAGDP21000000
ChinaPopulation1400000000
ChinaGDP15000000
IndiaPopulation1350000000
IndiaGDP3000000