# Reorder Columns (DP\_ROC)

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

```javascript
{
    "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

<mark style="color:green;">`POST`</mark> `https://autogon.ai/api/v1/engine/start`

#### Request Body

| Name                                             | Type   | Description                           |
| ------------------------------------------------ | ------ | ------------------------------------- |
| project\_id<mark style="color:red;">\*</mark>    | int    | current project ID                    |
| parent\_id<mark style="color:red;">\*</mark>     | int    | parent block ID                       |
| block\_id<mark style="color:red;">\*</mark>      | int    | current block ID                      |
| function\_code<mark style="color:red;">\*</mark> | String | block's function code                 |
| args                                             | object | block arguments                       |
| position<mark style="color:red;">\*</mark>       | int    | specifies new position in the dataset |
| column<mark style="color:red;">\*</mark>         | int    | specifies column to move              |

{% tabs %}
{% tab title="200: OK Data Encode Successful" %}

```javascript
{
    "status": "true",
    "message": {
        "id": 3,
        "project": 1,
        "block_id": 7,
        "parent_id": 6,
        "dataset_url": "",
        "x_value_url": "",
        "y_value_url": ""
    }
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Python" %}

```
// Some code
```

{% endtab %}

{% tab title="Node" %}

```
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.autogon.ai/autogon-engine-studio/data-processing/reorder-columns-dp_roc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
