for rw in range(self.m):
row = [sum(el) for el in zip(self.mx[rw], other_matrix[rw])]
summx[rw] = row
return temp
I searched for hours and hours to find a solution, tried different approaches. Some people even use the same code as I do, so I'm definitely doing something wrong. The only thing I can't seem to figure out is what.
I keep getting the error:
Traceback (most recent call last):
File "testmatrix.py", line 33, in <module>
j = g.sum(i)
File "/home/axelle/matrix.py", line 45, in sum
row = [sum(el) for el in zip(self.mx[rw], other_matrix[rw])]
TypeError: 'Matrix' object does not support indexing
Please help, I'm kinda desperate ^.^
Thanks in advance.
Comments
Leave a comment