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"])
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 |