Data can be organized into tables in different ways. In this lesson, you will learn to recognize “long” and “wide” formats and convert from one to the other, which is called reshaping.

⭐️Here is a short tutorial on reshaping data from long to wide formats

Long format tables contain only one column with measured values, in this case Count of incidents. All other columns are variables that describe what is measured.
Each row is a unique measurement. In this case, each unique of Complaint date is combined with each unique Borough.

In a wide format table, the same data is organized differently. There can be one or more columns of measurements, and what is being measured is described by the column names.

Once you understand how you want your table to be formatted, reshaping takes only a few steps:   

Reshape from Long to wide

  1. Add the Reshape step and select Long to wide 
  2. Select Row variables (the data you want to display in red, in the example above). You can select up to two of them. 
  3. Select the column variable (the data you want to display in yellow, in the example above, in the header).

 From wide to long

  1. Add the Reshape step and select  Wide to long  
  2. Select one Row variable (the data you want to display in red, in the example above). New variable columns and a value column will be created. 

 

 

 

 

Did this answer your question?