Day 3 of The Data School - Reshaping Data

In the first week of The Data School we have learned how we can reshape data during the data preparation stage. Five methods for this are listed below.

  1. Filtering

This is to ensure we are only looking at the most relevant and accurate data. Usually done by filtering out one or multiple values from a data field, which leads to the whole records being removed.

  1. Pivoting

Pivoting involves transforming rows to columns or columns to rows.
Columns to rows is useful when we want to update data sets with future records. Rows to columns converts each metric to its own columns.

  1. Aggregation

Aggregating data reduces the granularity. Granularity is the the unique combination of categorical fields that define each record. Removing at least one of these fields will reduce the granularity.

  1. Unions

Stacking data sets on top of each other to increase the number of records is forming a union. To do this we require matching or similar data fields.

  1. Joins

If we bring two data sets together to increase the number of data fields, this is forming a join. To do this we must have join condition - a matching data field in each data set to tie them together.

We can create inner or outer joins. Inner joins only keep records that are matched in both tables, and outer join keeps all records from both tables, whether matched or not.

Author:
Jessica Robbin
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab