root_numpy.matrix¶
-
root_numpy.
matrix
(mat)¶ Convert a ROOT TMatrix into a NumPy matrix.
Parameters: mat : ROOT TMatrixT
A ROOT TMatrixD or TMatrixF
Returns: mat : numpy.matrix
A NumPy matrix
Examples
>>> from root_numpy import matrix >>> from ROOT import TMatrixD >>> a = TMatrixD(4, 4) >>> a[1][2] = 2 >>> matrix(a) matrix([[ 0., 0., 0., 0.], [ 0., 0., 2., 0.], [ 0., 0., 0., 0.], [ 0., 0., 0., 0.]])