Power N Column
This transform calculates the nth power of each value in a specific column.
tags: [“Data Preparation”]
Parameters
The table gives a brief description about each parameter in Power N 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. (Required: True, Multiple: False)
- Output Dataset:
The file name with which the dataset is created. This file contains the raised power of each value in a specific column.(Required: True, Multiple: False)
- Column:
The column to which the power n to be applied. (Required: True, Multiple: False, Datatypes: [“STRING”], Options: [“FIELDS”], Datasets: [“df”])
- Power:
The power value to be applied to each element in the column. (Required: True, Multiple: False, Datatypes: [“FLOAT”], Options: [“CONSTANT”])
The sample input for this transform looks as shown in the screenshot:
The output after running the Power N Column transform on the dataset appears as below:
How to use it in Notebook
The following is the code snippet you must use in the Jupyter Notebook editor to run the Power N Column transform:
template=TemplateV2.get_template_by('Power N Column')
recipe_Power_N_Column= project.addRecipe([car_data, employee_data, temperature_data, only_numeric], name='Power N Column')
transform=Transform()
transform.templateId = template.id
transform.name='Power N Column'
transform.variables = {
'input_dataset':'only_numeric',
'output_dataset':'pncds',
'col':"Age",
'n':3}
recipe_Power_N_Column.add_transform(transform)
recipe_Power_N_Column.run()
Requirements
pandas