Table of Differences between the Numpy Array and Numpy Matrix

Numpy np.array()

Numpy np.matrix() 

Syntax:  numpy.array(object, dtype=None)

Syntax: numpy.matrix(object, dtype=None)

Numpy arrays (nd-arrays) are N-dimensional where, N=1,2,3…

Numpy matrices are strictly 2-dimensional.

nd-arrays are base classes for matrix objects

Matrix objects are a subclass of nd-array.

Matrix objects have arr.I for the inverse.

Array objects don’t.

If a and b are matrices, then a@b or np.dot(a,b) is their matrix product

If a and b are matrices, then a*b is their matrix product.



Difference between Numpy array and Numpy matrix

While working with Python many times we come across the question that what exactly is the difference between a numpy array and numpy matrix, in this article we are going to read about the same.

Similar Reads

What is np.array() in Python

The Numpy array object in Numpy is called ndarray. We can create ndarray using numpy.array() function. It is used to convert a list, tuple, etc. into a Numpy array....

What is numpy.matrix() in Python

...

Difference between Numpy array and Numpy Matrix

A matrix in Numpy returns a matrix from a string of data or array-like object. The matrix obtained is a specialized 2D array....

Table of Differences between the Numpy Array and Numpy Matrix

...

Contact Us