(self, other)
return self
In-place subtraction of a matrix or scalar.
In-place subtraction of a matrix or scalar.
In - place subtraction of a matrix or scalar .
def __isub__(self, other):
        """In-place subtraction of a matrix or scalar."""
        if isinstance(other, Matrix):
            if self.shape != other.shape:
                raise ValueError("matrix shapes do not match")
            for row_a, row_b in zip(self._data, other):
                for i in range(len(row_a)):
                    row_a[i] -= row_b[i]
        else:
            for row in self._data:
                for i in range(len(row)):
                    row[i] -= other
        return self
def __isub__ ( self , other ) : if isinstance ( other , Matrix ) : if self . shape != other . shape : raise ValueError ( "matrix shapes do not match" ) for row_a , row_b in zip ( self . _data , other ) : for i in range ( len ( row_a ) ) : row_a [ i ] -= row_b [ i ] else : for row in self . _data : for i in range ( len ( row ) ) : row [ i ] -= other return self