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.