Sort by Column

This transform returns rows or values of a given column in ascending order along with the index of each value.

tags: [“EDA”]

Parameters

The table gives a brief description about each parameter in Sort by 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 for sorting a column in ascending order. (Required: True, Multiple: False)

Output Dataset:

The file name with which the output dataset is created after sorting a particular column in the ascending order. (Required: True, Multiple: False)

Column Name:

The name of the column on which the sort by column transform must be performed. (Required: True, Multiple: False, Datatypes: [“STRING”], Options: [“FIELDS”], Datasets: [“df”])

The sample input for this transform looks as shown in the screenshot:

../../../_images/sortbycolumn_input.png

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

../../../_images/sortbycol_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 Sort by Column transform:

template=TemplateV2.get_template_by('Sort by Column')

recipe_Sort_by_Column= project.addRecipe([car_data, employee_data, temperature_data, only_numeric], name='Sort by Column')

transform=Transform()
transform.templateId = template.id
transform.name='Sort by Column'
transform.variables = {
'input_dataset':'only_numeric',
'output_dataset':'only_numeric_sorted',
'col1':"Age"}
recipe_Sort_by_Column.add_transform(transform)
recipe_Sort_by_Column.run()

Requirements

pandas