Add Value Column

This add value column transform allows you to add a value to every element in an existing column and get the cumulative sum.

tags: [“Data Preparation”]

Parameters

The table gives a brief description about each parameter in Add value column transform.

Name:

By default, the transform name is populated. You can also add a custom name for the transform.

Input Dataset:

The name of the dataset file you are uploading. All the datasets uploaded for this project are populated in the drop-down list from which you can choose the appropriate one. (Required: True, Multiple: False)

Output Dataset:

The name of the output dataset file. (Required: True, Multiple: False)

Value:

The value that you want to add to the column. (Required: True, Multiple: False, Datatypes: [“LONG”], Options: [‘CONSTANT’])

Column:

The name of the column to which the value must be added. The column name must be same as in the dataset. (Required: True, Multiple: True, Options: [‘FIELDS’], Datasets: [‘df’])

Sample input for Add Value column transform:

../../../_images/addvalue.png

The output of the add value column transform looks as below:

../../../_images/addvalue_output.png

Using this transform in Notebook

The following is the code snippet you must use in the Jupyter Notebook editor to run the **Add Value Column**transform:

template=TemplateV2.get_template_by('Add Value Column')

recipe_Add_Value_Column= project.addRecipe([car_data, employee_data, temperature_data, only_numeric], name='Add Value Column')

transform=Transform()
transform.templateId = template.id
transform.name='Add Value Column'
transform.variables = {
'input_dataset':'only_numeric',
'output_dataset':'addvc',
'value':1,
'col':"Age"}
recipe_Add_Value_Column.add_transform(transform)
recipe_Add_Value_Column.run()

Requirements

pandas