numpy.matrix.A() function - Python
Last Updated :
18 Jun, 2020
Improve
numpy.matrix.A()
function return self as an ndarray object.
Syntax : numpy.matrix.A() Parameters : None Return : [ndarray] Return self as an ndarray.Code #1 :
# Python program explaining
# numpy.matrix.A() function
# importing numpy as geek
import numpy as geek
mat = geek.matrix(geek.arange(9).reshape((3, 3)))
gfg = mat.getA()
print (gfg)
[[0 1 2] [3 4 5] [6 7 8]]Code #2 :
# Python program explaining
# numpy.matrix.A() function
# importing numpy as geek
import numpy as geek
mat = geek.matrix(geek.arange(20).reshape((4, 5)))
gfg = mat.getA()
print (gfg)
[[ 0 1 2 3 4] [ 5 6 7 8 9] [10 11 12 13 14] [15 16 17 18 19]]