Thursday, November 20, 2025
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
32404 POSTS0 COMMENTS
Milvus
97 POSTS0 COMMENTS
Nango Kala
6776 POSTS0 COMMENTS
Nicole Veronica
11925 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11994 POSTS0 COMMENTS
Shaida Kate Naidoo
6905 POSTS0 COMMENTS
Ted Musemwa
7160 POSTS0 COMMENTS
Thapelo Manthata
6861 POSTS0 COMMENTS
Umr Jansen
6846 POSTS0 COMMENTS