Brick provides a possibility to create new features by creating a new column.
Description
Brick Location
Bricks → Data Manipulation→ Convert/Replace → Create New Column
Brick Parameters
Setting
One of the options available in the drop-down menu: 'Add a flat value', 'Add a function output', 'Add a list of values as a new column', and 'Add an empty column'.
Value1
Text input field. This field is obligatory for setting = 'Add a flat value' only.
Function
List of possible functions to apply. Additional parameter required for a setting = 'Add a function output' only.
List of values
Text input field. Additional parameter required for a setting = 'Add a list of values as a new column' only.
Separator
Text input field. Additional parameter required for a setting = 'Add a list of values as a new column' only.
New Column Name
Input field. This field is obligatory for any setting selected.
Brick Inputs/Outputs
Inputs
Brick takes the dataset (optionally in case of setting='Add a list of values as a new column').
Outputs
Brick produces the result as an extended input dataset with one additional column called as specified in the parameter "New Column Name" or a dataset with only one column in case of setting='Add a list of values as a new column'.
Description
You should use this brick when there is a need to create an additional column. There are several options available on how a new column is going to be created.
Example of usage
You should select one setting from the drop-down brick menu. Depending on the selected setting and the input data, an additional column would be added to the output dataset. The following options are available:
Add a flat value
Mandatory inputs:
Value to populate column with
New column name
Example: added column Year populated with value of 2020
Add a function output
Mandatory inputs:
New column name
One function from the following:
Range numerates rows starting from 0
Example:
Random integer (from and to) assigns each row random integer value from the input interval
Example: random integer (from 1 to 100)
Random float (from and to) assigns each row random float value from the input interval
Example: random float (from 1 to 10)
Random value from the list assigns each row random value from the input list
Example: random value from the list "one, two, three, four, five", with comma separator
Add a list of values as a new column
Mandatory inputs:
List of values
Separator
New column name
Example1: add list of values "one, two, three, four" to the input data1 as a new column
Example2: add list of values "one, two, three, four" as a column in the new dataset