Change Value of Specific Cell

This transform changes the value of a cell in a particular column based on its index.

tags: [“Data Preparation”]

Parameters

The table gives a brief description about each parameter in Change Value of Specific Cell 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 to change the value of a particular cell in a column. (Required: True, Multiple: False)

Output Dataset:

The file name with which the output dataset is created. This file has the new value in the cell of a particular column. (Required: True, Multiple: False)

index:

The index of the cell in a column where the value must be replaced. (Required: True, Multiple: False, Datatypes: [‘ANY’], Options: [“FIELDS”], Datasets: [“df”])

column:

The column name in which you want to change the value of a cell. (Required: True, Multiple: False, Datatypes: [‘ANY’], Options: [“FIELDS”], Datasets: [“df”])

new value:

The new value with which the old value in the cell must be replaced. (Required: True, Multiple: False, Datatypes: [‘ANY’], Options: [“CONSTANT”])

Sample input for Change Value of Specific Cell transform:

../../../_images/changevalue_input.png

The output after running the Change Value of Specific Cell transform on the dataset appears as below:

../../../_images/changevalue_output.png

How to use it in Notebook

The following is the code snippet you must use in the Jupyter Notebook editor to run the Change Value of Specific Cell transform:

template=TemplateV2.get_template_by('Change Value of Specific Cell')

recipe_Change_Value_of_Specific_Cell= project.addRecipe([car_data, employee_data, temperature_data, only_numeric], name='Change Value of Specific Cell')

transform=Transform()
transform.templateId = template.id
transform.name='Change Value of Specific Cell'
transform.variables = {
'input_dataset':'car',
'output_dataset':'car_changed',
'value_1':2,
'value_2':"carbody",
'value_3':"abc"}
recipe_Change_Value_of_Specific_Cell.add_transform(transform)
recipe_Change_Value_of_Specific_Cell.run()

Requirements

pandas