old_contents: # Copyright 2012 the rootpy developers
  # distributed under the terms of the GNU General Public License
  import ROOT
  
  
  def Matrix(rows, cols, type='F'):
  
      if type == 'F':
          return ROOT.TMatrixF(rows, cols)
      elif type == 'D':
          return ROOT.TMatrixD(rows, cols)
      raise TypeError("No matrix for type '%s'" % type)
  
new_contents: # Copyright 2012 the rootpy developers
  # distributed under the terms of the GNU General Public License
  
  from itertools import product
  
  import numpy as np
  import ROOT
  
  
  def Matrix(rows, cols, type='F'):
  
      if type == 'F':
          return ROOT.TMatrixF(rows, cols)
      elif type == 'D':
          return ROOT.TMatrixD(rows, cols)
      raise TypeError("No matrix for type '%s'" % type)
  
  def as_numpy(root_matrix):
      cols, rows = root_matrix.GetNcols(), root_matrix.GetNrows()
      return np.matrix([[root_matrix[i][j] for j in range(cols)] for i in xrange(rows)])
  
subject: Add rootpy.math.linalg.matrix.as_numpy for TMatrix->numpy.matrix