Concat Columns
This function is used to concatenate the values of two columns in a dataset into a new column.
tags: [“Data Preparation”]
Parameters
The table provides a brief description about each parameter in Concat Columns transform.
- Name:
By default, the transform name is populated. You can also add a custom name for the transform.
- Input Dataset:
The file name of the input dataset. You can select the dataset that was uploaded from the drop-down list. (Required: True, Multiple: False)
- Concatenated Column:
The name of new column to be created after concatenation (Required: True, Multiple: False, Datatypes: [‘STRING’], Options: [‘CONSTANT’])
- Column 1:
The first column to be concatenated from the dataset. (Required: True, Multiple: False, Datatypes: [‘ANY’], Options: [‘FIELDS’] , Datasets: [‘df’])
- Column 2:
The second column to be concatenated from the dataset. (Required: True, Multiple: False, Datatypes: [‘ANY’], Options: [‘FIELDS’] , Datasets: [‘df’])
- Separator:
The separator used between the text or values of two columns. The seperator can be space, comman, underscore, hypen, and so on. (Required: True, Multiple: False, Datatypes: [‘STRING’], Options: [‘CONSTANT’], Default_value: ‘-‘)
- Output Dataset:
The file name with which the output dataset is created adding a new column after concatenation. (Required: True, Multiple: False)
Sample input for Concat Columns transform:
The output after running the Concat Columns transform on the dataset appears as below:
Using this transform in Notebook
The following is the code snippet you must use in the Jupyter Notebook editor to run the Concat Columns transform:
template=TemplateV2.get_template_by('Concat Columns')
recipe_Concat_Columns= project.addRecipe([car_data, employee_data, temperature_data, only_numeric], name='Concat Columns')
transform=Transform()
transform.templateId = template.id
transform.name='Concat Columns'
transform.variables = {
'input_dataset':'car',
'column_concatenated':"id_name",
'column1':"car_ID",
'column2':"CarName",
'separator':"_",
'output_dataset':'car_concat'}
recipe_Concat_Columns.add_transform(transform)
recipe_Concat_Columns.run()
Requirements
pandas