General information
Brick “Shift Data” gives a possibility to shift selected columns by desired number of periods.This function takes a scalar parameter called a period, which represents the number of shifts to be made. This brick is very helpful when dealing with time-series data.
Description
Brick Location
Bricks → Data Manipulation → Shift Data
Brick Parameters
- Columns
Column from the input data to shift and also a period to shift by. You can add or remove columns by clicking “+” , “-” relatively.
Brick Inputs/Outputs
- Inputs
Brick takes the dataset.
- Outputs
Brick produces the result as a new dataset, with shifted column/columns
Example of usage
Let's consider we have data about holidays. It consists of three columns: date, name, holiday_trans.
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F866d2ab2-00e8-48c5-808c-f9175896eefd%2FUntitled.png?table=block&id=8e159e9f-8b0d-421a-991e-bf5b25c4d8fb&cache=v2)
You should select a column and a period for it. Each column from the dataset could be selected multiple times.
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fff6088dc-9460-4786-96d2-027f0f58ee25%2FUntitled.png?table=block&id=d7b8d42d-b920-44b9-b576-a4dc4ed79e6e&cache=v2)
As a result, an additional column with the name generated by default (e.g. date_shift_3, date_shift_-2) would be added to the output dataset.
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa11840f9-66af-47b4-a335-8bd1f070e0a9%2FUntitled.png?table=block&id=4683991c-47de-48cd-b739-60ba8cb2fd1a&cache=v2)