Set array[row][column] = value where loc = (row, column). Example: >>> a = Matrix(2, 3, 1) >>> a[1, 2] = 51 >>> a Matrix consist of 2 rows and 3 columns [ 1, 1, 1] [ 1, 1, 51]
(self, loc: tuple[int, int], value: float)
| 85 | return self.array[loc[0]][loc[1]] |
| 86 | |
| 87 | def __setitem__(self, loc: tuple[int, int], value: float) -> None: |
| 88 | """ |
| 89 | <method Matrix.__setitem__> |
| 90 | Set array[row][column] = value where loc = (row, column). |
| 91 | Example: |
| 92 | >>> a = Matrix(2, 3, 1) |
| 93 | >>> a[1, 2] = 51 |
| 94 | >>> a |
| 95 | Matrix consist of 2 rows and 3 columns |
| 96 | [ 1, 1, 1] |
| 97 | [ 1, 1, 51] |
| 98 | """ |
| 99 | assert self.validate_indices(loc) |
| 100 | self.array[loc[0]][loc[1]] = value |
| 101 | |
| 102 | def __add__(self, another: Matrix) -> Matrix: |
| 103 | """ |
nothing calls this directly
no test coverage detected