rename_columns
Change column names in dataframes using a dictionary mapping from old to new names for better data organization and clarity.
Instructions
Rename columns in the dataframe.
Returns: Dict with rename details
Examples: # Using dictionary mapping rename_columns(ctx, {"old_col1": "new_col1", "old_col2": "new_col2"})
# Rename multiple columns
rename_columns(ctx, {
"FirstName": "first_name",
"LastName": "last_name",
"EmailAddress": "email"
})
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mapping | Yes | Dictionary mapping old column names to new names |
Input Schema (JSON Schema)
{
"properties": {
"mapping": {
"additionalProperties": {
"type": "string"
},
"description": "Dictionary mapping old column names to new names",
"type": "object"
}
},
"required": [
"mapping"
],
"type": "object"
}