Wide_and_narrow_data

Wide and narrow data

Wide and narrow data

Add article description


Wide and narrow (sometimes un-stacked and stacked, or wide and tall) are terms used to describe two different presentations for tabular data.[1][2]

Wide

Wide, or unstacked data is presented with each different data variable in a separate column.

More information Person, Age ...

Narrow

Narrow, stacked, or long data is presented with one column containing all the values and another column listing the context of the value

More information Person, Variable ...

This is often easier to implement; addition of a new field does not require any changes to the structure of the table, however it can be harder for people to understand.

Implementations

Many statistical and data processing systems have functions to convert between these two presentations, for instance the R programming language has several packages such as the tidyr package. The pandas package in Python implements this operation as "melt" function which converts a wide table to a narrow one. The process of converting a narrow table to wide table is generally referred to as "pivoting" in the context of data transformations. The "pandas" python package provides a "pivot" method which provides for a narrow to wide transformation.

See also


References

  1. Thompson, M. E. (1997), Theory of sample surveys, Chapman & Hall, London. ISBN 0-412-31780-X
  2. Chantala, K. (2006) "Using STATA to Analyze data from a Sample Survey". 1-10-2001. UNC Chapel Hill, Carolina Population Center. 10-1-2006.

Share this article:

This article uses material from the Wikipedia article Wide_and_narrow_data, and is written by contributors. Text is available under a CC BY-SA 4.0 International License; additional terms may apply. Images, videos and audio are available under their respective licenses.