Replace Value
This transform is used to replace an existing value with a new value in the dataset.
tags: [“Data Preparation”, “Cleaning”]
Parameters
The table gives a brief description about each parameter in Replace Value 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)
- Value:
The value to be replaced (Required: True, Multiple: False, Datatypes: [‘ANY’], Options: [“CONSTANT”], Datasets: [‘df’])
- New Value:
The new value with which the old value must be replaced. (Required: True, Multiple: False, Datatypes: [‘ANY’], Options: [“CONSTANT”], Datasets: [‘df’])
- Output Dataset:
The file name with which the output dataset is created after replacing the old value with new value in the input dataset. (Required: True, Multiple: False)
The sample input for this transform looks as shown in the screenshot:
The output after running the Replace Value transform on the dataset appears as below:
How to use it in Notebook
template=TemplateV2.get_template_by('Replace Value')
recipe_Replace_Value= project.addRecipe([car_data, employee_data, temperature_data, only_numeric], name='Replace Value')
transform=Transform()
transform.templateId = template.id
transform.name='Replace Value'
transform.variables = {
'input_dataset':'car',
'value_1':"gas",
'value_2':"petro",
'output_dataset':'car_replace'}
recipe_Replace_Value.add_transform(transform)
recipe_Replace_Value.run()
Requirements
pandas