This is a pre-release version (2.5.0.dev0+git20251130.2de293a).Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / matrixlib / defmatrix / matrix / tolist

function

numpy.matrixlib.defmatrix:matrix.tolist

source: build-install/usr/lib/python3.14/site-packages/numpy/matrixlib/defmatrix.py:272

Signature

def tolist(self)

Summary

Return the matrix as a (possibly nested) list.

Extended Summary

See ndarray.tolist for full documentation.

Examples

x = np.matrix(np.arange(12).reshape((3,4))); x
x.tolist()
✓
[[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]]

See also

ndarray.tolist

Aliases

  • numpy.matrix.tolist