# NumPy

## 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, …

## How to use Numpy Convolve in Python?

Digital electronics always rely on processing signals for their routine functioning. The support from Python extends to this part of the spectrum too! The operation of combining signals is known as convolution and Python has an exclusive function to carry it out. This function lies within the numpy library. So, let us start by importing …

## How to find the QR Factorization of Matrix using Numpy?

Working with matrices is always fascinating. The numpy library has a ton of functions that helps with carrying out complicated calculations using matrices. In this article, we shall demonstrate one such function that decomposes a given matrix into a pair of entities. This process is called factorization of a matrix & the function of interest …

## How to Use Numpy i0 in Python?

This article will talk about the Numpy i0 function. The year was 1817. It was a fine evening when a German astronomer by the name of Friedrich Wilhelm Bessel was taking a closer look at the movement of planets. Well, what else could he have referred to rather than the most advanced source available around …

## Numpy interp – One-dimensional linear interpolation for monotonically increasing sample points

In this article, we will understand and implement numpy.interp() which is a NumPy function. When given discrete data points (xp, fp), this function returns the one-dimensional piecewise linear interpolant to that function, which is evaluated at x. What is Numpy interp? numpy.interp() calculates linear interpolant to a function with given data points, the data points given (xp values)are …

## How to Use Numpy Positive in Python?

This article would be covering a rather strange function within the numpy library of Python. It is so strange that at prima facie one might even question its very existence. Enter the numpy.positive( ) function! It returns the element-wise numerical positive for the input array. Makes sense right? But, here is the catch! It does …