Matrix.
rename_choices
Update the name of a given choice
choice (Optional[str]) – The old choice name.
name (Optional[str]) – The new choice name.
**old_to_new_names (str) – The mapping of old names to new names.
TypeError – If neither (criterion and name) nor old_to_new_names is given.
TypeError
criterion
name
old_to_new_names
Examples
>>> import matrix >>> m = matrix.Matrix('apple', 'orange') >>> m.rename_choices('apple', 'pear') >>> m |:-------| | Weight | | pear | | orange |
>>> m = matrix.Matrix('apple', 'orange') >>> m.rename_choices(apple='pear', orange='lemon') >>> m |:-------| | Weight | | pear | | lemon |