# NumPy

## How to Compute the Dot Product of Arrays Using Linalg.multi_dot?

The dot product of the arrays can be calculated by the function called linalg.multi_dot of the NumPy library, which is easier to compute and takes less computational time than its predecessor, np.dot. We are also going to see the comparison of np.dot and multi_dot in this post. Find everything you need to know about how …

## Usage of nan_to_num in replacing NaN and Infinity

nan_to_num is a function of numpy library that converts NaN (not a number) to a numeric value. The NaN is generally replaced with zero whenever we call upon nan_to_num function. We might come across some datasets with records or values that may not be represented or are usually undefined. Such values are termed as Not …

## Numpy LinAlgError – Handling Matrix-related Errors

In python, the Base exception is the class from which all instances of exceptions are derived. Exceptions may be raised by built-in functions or the interpreter or both. User-defined programs can also raise exceptions . One such example of a built-in exception is the LinAlgError. The LinAlgError is raised by the linalg or the linear …

## Numpy Linalg.matrix_rank – Explained

When you want to try your luck with solving a system of linear equations, your odds are better if you have the information on the rank of the matrices beforehand. The possibility of deducing a solution is concrete when the rank of the matrix and the number of variables is alike. A rank is like …

## Numpy linalg.slogdet – Compute logarithmic determinant of arrays

Numpy contains a multitude of functions for easier mathematical calculations. One such function is the numpy linalg.slogdet() which is used to compute the sine and natural logarithm of the determinant of an array. In multivariate statistics, the log determinant of a matrix is useful in a high-dimensional space. It is used to determine the convexity …

## Numpy linalg.lstsq – Return the least-squares solution to a linear matrix equation

The NumPy library in Python provides a powerful set of tools for numerical and scientific computing. One of the important functions in NumPy is the linalg.lstsq function, which solves the linear matrix equation using the least-squares method. This function is commonly used in a variety of applications such as regression analysis, curve fitting, and other …

## Numpy linalg.eigvalsh: A Guide to Eigenvalue Computation

The Numpy library provides a function linalg.eigvalsh that calculates the eigenvalues of a complex Hermitian or real symmetric matrix. This function is efficient and robust, making it a valuable tool for linear algebraic computations. In this article, we will explore the functionality of linalg.eigvalsh and how it can be used to obtain the eigenvalues of …

## Numpy linalg.cond() – Compute the condition number of a matrix

The condition number defines the sensitivity of the output with respect to minute changes in the input data. It is an important feature of a matrix as it helps in identifying rounding off errors while solving systems of linear equations. It predicts the worst-case change in output due to some relative change in the input …

## Numpy linalg.pinv(): Computing the Pseudo-Inverse of a Matrix

Most of us would be familiar with the term inverse while operating with matrices. But what on earth is a pseudo-inverse? If it is pseudo which in turn means a false entity, then why bother using it? This seemingly contradicting function is what we would be exploring in this article. The linalg.pinv( ) function is …

## Numpy linalg.tensorinv( ): Computing Inverse of an N-Dimensional Array

Finding an inverse is one of the peculiar operations to be carried out in the field of Mathematics. In this article, we shall explore one such function from the numpy library to its length & breadth. This function is used to return the inverse of an N-dimensional array. For those who havenâ€™t figured it out yet, …