NumPy has a separate module for linear algebra. The module contains all the functions necessary for linear algebra. numpy.linalg is the package in NumPy for NumPy Linear Algebra. Linear Algebra is the branch of mathematics concerned with vector spaces and mapping amongst the spaces.

NumPy Linear Algebra

NumPy Linear Algebra

Let us see various Matrix and Vector Products in NumPy:

Matrix and Vector Products

For matrix and vector computations it has the following functions:

  • dot()- it can calculate the dot product of two arrays
  • vdot()- it can calculate the dot product of two vectors
  • inner()- it can calculate the inner product of arrays
  • outer()- it can compute the outer products of two arrays
  • matmul()- it can determine the matrix multiplication of two arrays
  • det()- it can calculate determinant of a matrix
  • solve()- it can solve linear matrix equation
  • inv()- it can calculate the multiplicative inverse of the matrix
  • trace()- it calculates the sum of diagonal elements
  • rank()- it returns the rank of the matrix

NumPy dot and vdot functions

The dot function gives the dot product of two matrices. It is similar to matrix multiplication.

The vdot function, on the other hand, is used for the dot product of two or more vectors. It is equivalent to the sum of the array elements.

#numpy tutorials #numpy eigenvalue functions #numpy

NumPy Linear Algebra and Matrix Functions
3.80 GEEK