create_column
Create a new column from a pandas expression for feature engineering, including ratios and interactions, while preventing division by zero.
Instructions
Create a new column using a pandas eval expression. Columns are referenced by name. For domain-relevant feature engineering: ratios, differences, interactions. Always add epsilon (1e-5) to denominators to avoid division by zero. Example: create_column(new_column="Yield", expression="Revenue / (ChargeableWeight + 1e-5)") Example: create_column(new_column="WeightPerPiece", expression="ChargeableWeight / (Pieces + 1e-5)")
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"new_column": "<new_column>",
"expression": "<expression>"
},
"name": "create_column"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| df_name | No | ||
| expression | Yes | ||
| new_column | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |