(self, data=None)
Sets the data stored in the matrix
Sets the data stored in the matrix
Sets the data stored in the matrix
def _set_data(self, data=None):
        """Sets the data stored in the matrix"""
        if data is not None:
            self._data = [list(row) for row in data]
            self._nrow = len(self._data)
            if self._nrow > 0:
                self._ncol = max(len(row) for row in self._data)
            else:
                self._ncol = 0
            for row in self._data:
                if len(row) < self._ncol:
                    row.extend([0] * (self._ncol - len(row)))
def _set_data ( self , data = None ) : if data is not None : self . _data = [ list ( row ) for row in data ] self . _nrow = len ( self . _data ) if self . _nrow > 0 : self . _ncol = max ( len ( row ) for row in self . _data ) else : self . _ncol = 0 for row in self . _data : if len ( row ) < self . _ncol : row . extend ( [ 0 ] * ( self . _ncol - len ( row ) ) )