Regarding matrix and numpy 2d array

when i created numpy 2d array i can access individual elements by [row][column] but when i converted it into a matrix by np.mat() then why i cant access to the individual elements by [row][column]

a=np.array([[1,2,3],[4,5,6],[7,8,9]])

a=np.mat(a)

print(a[0])

print(a[0][0])

the output is

[1,2,3]

[1,2,3] for both why it is so

hey @amankharb ,
Actually the thing is , np.mat have got different ways to access the data/values.
Taking the same above code of yours:

for numpy array:

a=np.array([[1,2,3],[4,5,6],[7,8,9]])

print( a[0] ) : output as [1,2,3]
print( a[0][0] ) : output as 1

and for matrix:

a=np.mat(a)

print( a[0] ) : output as [ [1,2,3] ]
print(a[0,0]) : output as 1

the thing is matrix ignores further indexing after a square bracket , hence we get the same results.
You can also perform slicing in the same way too like an example:

print( a[ :2, :2 ] ) # slicing to take first 2 rows and first 2 columns
output as:
[[1 2]
[4 5]]

I hope this might have resolved your doubt.