class_docstr: Simple matrix data type.
  
  Of course there are much more advanced matrix data types for Python (for
  instance, the C{ndarray} data type of Numeric Python) and this implementation
  does not want to compete with them. The only role of this data type is to
  provide a convenient interface for the matrices returned by the C{Graph}
  object (for instance, allow indexing with tuples in the case of adjacency
  matrices and so on).
class_docstr_tok: ["Simple","matrix","data","type",".","Of","course","there","are","much","more","advanced","matrix","data","types","for","Python","(","for","instance",",","the","C","{","ndarray","}","data","type","of","Numeric","Python",")","and","this","implementation","does","not","want","to","compete","with","them",".","The","only","role","of","this","data","type","is","to","provide","a","convenient","interface","for","the","matrices","returned","by","the","C","{","Graph","}","object","(","for","instance",",","allow","indexing","with","tuples","in","the","case","of","adjacency","matrices","and","so","on",")","."]
docstr: Sets the data stored in the matrix
code: 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)))
  
label_desc: Use image node_id 5 for calling the Matrix obj's underlying member method code with example usage: obj._set_data(data) without return types