Matrix.
rename_criteria
Update the name of a given criterion
criterion (Optional[str]) – The old criterion name.
name (Optional[str]) – The new criterion 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() >>> m.add_criteria('color', 'taste', weights=(4, 7)) >>> m.rename_criteria('color', 'colour') >>> m | | colour | taste | |:-------|---------:|--------:| | Weight | 4 | 7 |
>>> m = matrix.Matrix() >>> m.add_criteria('color', 'taste', weights=(4, 7)) >>> m.rename_criteria(color='colour', taste='flavour') >>> m | | colour | flavour | |:-------|---------:|----------:| | Weight | 4 | 7 |