Matrix.
rate_criterion
Given a criterion, assign ratings (dictionary values) to given choices (dictionary keys).
criterion (str) – The name of the criterion.
**choices_to_ratings (float) – The choice-rating pairs.
ValueError – If the given criterion is not continuous.
ValueError
Examples
>>> import matrix >>> m = matrix.Matrix( ... # choices=('apple', 'orange'), # No need to add choices here! ... criteria=('taste',), ... weights=(7,) ... ) >>> m.rate_criterion('taste', apple=7, orange=9) >>> m | | taste | Percentage | |:-------|--------:|:-------------| | Weight | 7 | | | apple | 7 | 70.0 | | orange | 9 | 90.0 |