matrix.Matrix.update_rating

Matrix.update_rating(choice: str, criterion: str, rating: float)

Update the rating given to the choice in the criterion

Parameters
  • choice (str) – The name of the choice whose rating is to be updated.

  • criterion (str) – The name of the criterion whose rating is to be updated.

  • rating (float) – The new rating value.

Examples

>>> import matrix
>>> m = matrix.Matrix(choices=('apple',), criteria=('taste',), weights=(7,))
>>> m.rate_criterion('taste', apple=4)
>>> m.update_rating('apple', 'taste', 8)
>>> m
|        |   taste | Percentage   |
|:-------|--------:|:-------------|
| Weight |       7 |              |
| apple  |       8 | 80.0         |