string_clean
Clean text columns by stripping whitespace, changing case, and replacing values to prevent spurious categories before encoding.
Instructions
Clean a string column. Operations applied in order: 'strip', 'lower', 'upper', 'title', 'replace'. For 'replace': uses replace_old and replace_new parameters. Run on text columns BEFORE any encoding. Inconsistent casing or whitespace creates spurious categories. Example: string_clean(column="Name", operations=["strip","lower"])
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": {
"column": "<column>"
},
"name": "string_clean"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| column | Yes | ||
| df_name | No | ||
| operations | No | ||
| replace_new | No | ||
| replace_old | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |