Drop Columns

This transform allows you to drop two columns by specifying the column names to be removed from the dataset.

tags: [“Data Preparation”, “Cleaning”]

Parameters

The table gives a brief description about each parameter in Drop Columns transform.

Name:

The name for the transform. By default, a name is populated. However, you can provide 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)

Column 1:

The name of the first column that must be removed or dropped from the dataset. You must enter the column name same as in the dataset. (Required: True, Multiple: False, Datatypes: [‘ANY’], Options: [‘FIELDS’] , Datasets: [‘df’])

Column 2:

The name of the second column that must be removed or dropped from the dataset. You must enter the column name same as in the dataset. (Required: True, Multiple: False, Datatypes: [‘ANY’], Options: [‘FIELDS’] , Datasets: [‘df’])

Output Dataset:

The file name with which the output dataset is created after dropping two mentioned columns from the input datasets. (Required: True, Multiple: False)

The sample input for this transform looks as below:

../../../_images/dropcol_input.png

The output after running the drop columns transform on the dataset appears as below:

Projects/templates_docs/templates_UI_images/dropcol_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 Drop Columns transform:

template=TemplateV2.get_template_by('Drop Columns')

recipe_Drop_Columns= project.addRecipe([car_data, employee_data, temperature_data, only_numeric], name='Drop Columns')

transform=Transform()
transform.templateId = template.id
transform.name='Drop Columns'
transform.variables = {
'input_dataset':'car',
'column1':"car_ID",
'column2':"CarName",
'output_dataset':'car_drop'}
recipe_Drop_Columns.add_transform(transform)
recipe_Drop_Columns.run()

Requirements

pandas