Divide Column

This transform divides a specific column with a given value. It is applicable for numerical columns.

tags: [“Data Preparation”]

Parameters

The table gives a brief description about each parameter in Divide Column 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 divide each numerical element in a specific column with a given value. (Required: True, Multiple: False)

Output Dataset:

The file name with which the output dataset is created. This file returns the dataset with the divided column. (Required: True, Multiple: False)

Value:

The value with which each element in the column is divided. (Required: True, Multiple: False, Datatypes: [“LONG”], Options: [‘CONSTANT’])

Column:

The name of the column to be divided.(Required: True, Multiple: True, Options: [‘FIELDS’], Datasets: [‘df’])

The sample input for this transform looks as below:

../../../_images/dividecolumn_input.png

The output after running the Divide Column transform on the dataset appears as below:

../../../_images/dividecolumn_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 Divide Column transform:

template=TemplateV2.get_template_by('Divide Column')

recipe_Divide_Column= project.addRecipe([car_data, employee_data, temperature_data, only_numeric], name='Divide Column')

transform=Transform()
transform.templateId = template.id
transform.name='Divide Column'
transform.variables = {
'input_dataset':'only_numeric',
'output_dataset':'divvc',
'value':1,
'col':"Age"}
recipe_Divide_Column.add_transform(transform)
recipe_Divide_Column.run()

Requirements

pandas