Reorder Columns (DP_ROC)

The process of reordering columns involves changing the sequence of columns to better suit the needs of analysis, visualization, or downstream processes.

Reordering columns is a fundamental data preprocessing step that can be achieved using various programming tools and libraries, such as pandas in Python. This operation is particularly valuable when dealing with datasets that have a large number of columns, as it helps streamline data analysis workflows and enhances data clarity.

The procedure usually involves specifying the desired order of columns, often by providing a list or defining the new column order. Libraries like pandas offer functions like reorder_columns that take the specified order as an input and generate a new dataframe with columns rearranged accordingly.

In practical scenarios, reordering columns can be employed for tasks like bringing essential information to the forefront, grouping related columns together, or ensuring a more intuitive flow of data. For instance, in a financial dataset, one might reorder columns to arrange date-related columns in chronological order, followed by transactional details, and then supplementary information.

Sample Request

{
    "project_id": 1,
    "parent_id": 5,
    "block_id": 6,
    "function_code": "DP_ROC",
    "args": {
        "column": 1,
        "posititon": 3,
        "dataset": false,
        "xtrain": true,
        "xtest": true,
        "x": true,
        "ytrain": false,
        "ytest": false,
        "y": false
    }
}

Request Parameters

Reorder Columns

POST https://autogon.ai/api/v1/engine/start

Request Body

NameTypeDescription

project_id*

int

current project ID

parent_id*

int

parent block ID

block_id*

int

current block ID

function_code*

String

block's function code

args

object

block arguments

position*

int

specifies new position in the dataset

column*

int

specifies column to move

{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
// Some code

Last updated