Hi bminehart ,
To address this, you can use the 'Add Transformation' option within your widget to rename categories.
Here’s a step-by-step approach you can follow:
Use 'Add Transformation' in the Widget:
Script for Transformation:
- In the Jupyter Notebook, under the transformation section, you can use the following script to rename your categories. Make sure to update the mapping variable to reflect your actual old and new category names. Be sure to replace 'Category' with the panel name of the column you added in the widget.
mapping = {
'old_name1': 'new_name 1', 'old_name2': 'new_name 2', 'old_name3': 'new_name 3', 'old_name4': 'new_name 4'
}
df_result = df_input
df_result['Category'] = df_input['Category'].map(lambda x: mapping.get(x, x))
![]()
This script maps the old category names to the new ones and ensures that the changes are applied correctly. If a category name does not match any key in the mapping dictionary, it will remain unchanged.
Thanks,
Hari
https://www.binextlevel.com/