# Column Astype (DP\_ASP)

This is a useful block in data processing that allows you to convert the data type of a column to a specified type. It provides flexibility in handling and transforming data by allowing you to change the data type of one or more columns.

## Sample Request

```javascript
{
    "project_id": 41,
    "block_id": 10,
    "parent_id": 9,
    "function_code": "DP_ASP",
    "args": {
        "astype": "int32",
        "columns": [0, 5, 7]
    }
}
```

## Parameter Details

## Column Astype

<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            |
| astype<mark style="color:red;">\*</mark>         | String | New datatype                     |
| args<mark style="color:red;">\*</mark>           | object | block arguments                  |
| columns<mark style="color:red;">\*</mark>        | Array  | Columns to apply type conversion |

{% 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" %}

```javascript
// Column AsType
const Client = require("./src/client");

let client = new Client(process.env.AUTOGON_API_KEY);

projectId = 41;
parentId = 9;
blockId = 10;

dataInput = (await client.columns_astype(projectId, parentId, blockId, {
    astype: "int32",
    columns: [0, 5, 7]
})).data;
```

{% endtab %}
{% endtabs %}
