Differences Between Arrays and Matrices in Numpy

N

Nanime Puloski

What are some differences between arrays and matrices using the Numpy
library? When would I want to use arrays instead of matrices and vice
versa?
 
N

Nobody

What are some differences between arrays and matrices using the Numpy
library?

Matrices are always two-dimensional, as are slices of them. Matrices
override mulitplication and exponentiation to use matrix multiplication
rather than element-wise multiplication.
When would I want to use arrays instead of matrices and vice
versa?

Use a matrix if you want a matrix, i.e. a linear transformation.
Otherwise, use an array.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top