Thursday, February 19, 2026
HomeLanguagesnumpy.matrix.A() function – Python

numpy.matrix.A() function – Python

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)


Output :

[[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)


Output :

[[ 0  1  2  3  4]
 [ 5  6  7  8  9]
 [10 11 12 13 14]
 [15 16 17 18 19]]
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32506 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6882 POSTS0 COMMENTS
Nicole Veronica
12005 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12099 POSTS0 COMMENTS
Shaida Kate Naidoo
7011 POSTS0 COMMENTS
Ted Musemwa
7255 POSTS0 COMMENTS
Thapelo Manthata
6967 POSTS0 COMMENTS
Umr Jansen
6956 POSTS0 COMMENTS