Gaurav Kumar has Published 50 Articles

What is the use of scipy.interpolate.interp1d class of SciPy python library?

Gaurav Kumar

Gaurav Kumar

Updated on 14-Dec-2021 11:48:18

The scipy.interpolate.interp1d(x, y, kind, axis, copy, bounds_error, fill_value, assumesorted) class of SciPy library, as name implies, is used to interpolate a 1-Dimensional function. Here, x and y are the arrays of values which are used to approximate some function, say f; y=f(x). The output of this class is a function ... Read More

What is the difference between SciPy and NumPy?

Gaurav Kumar

Gaurav Kumar

Updated on 14-Dec-2021 11:47:50

NumPy, stands for Numerical Python, is used for the manipulation of elements of numerical array data. SciPy, stands for Scientific Python, is used for numerical computations in Python. Both these packages provide extended functionality to work with Python. Let’s understand some basic differences between NumPy and SciPy −Functional differences − NumPy ... Read More

SciPy is built upon which core packages?

Gaurav Kumar

Gaurav Kumar

Updated on 14-Dec-2021 11:47:25

SciPy is built upon the following core packages −Python − Python, a general-purpose programming language, is dynamically typed and interpreted. It is well suited for interactive work and quick prototyping. It is also powerful to write AI and ML applications.NumPy − NumPy is a base N-dimensional array package for SciPy that allows ... Read More

How do I install Python SciPy?

Gaurav Kumar

Gaurav Kumar

Updated on 14-Dec-2021 11:35:14

We can install Python SciPy with the help of following methods −Scientific Python Distributions − There are various scientific Python distributions that provide the language itself along with the most used packages. The advantage of using these distributions is that they require little configuration and work on almost all the setups. ... Read More

What are various sub-packages in Python SciPy library?

Gaurav Kumar

Gaurav Kumar

Updated on 14-Dec-2021 11:29:20

To cover different scientific computing domains, SciPy library is organized into various sub-packages. These sub-packages are explained below −Clustering package (scipy.cluster) − This package contains clustering algorithms which are useful in information theory, target detection, compression, communications, and some other areas also. It has two modules namely scipy.cluster.vq and scipy.cluster.hierarchy. As ... Read More

What is SciPy and why should we use it?

Gaurav Kumar

Gaurav Kumar

Updated on 14-Dec-2021 11:27:50

SciPy, pronounced as “Sigh Pie”, is an ecosystem of Python open-source libraries for performing Mathematical, Scientific, and Engineering computations. SciPy stands for Scientific Python and is comprised of the following core packages, called SciPy ecosystem −NumPy − NumPy is a base N-dimensional array package for SciPy that allows us to efficiently ... Read More

How to find the Eigenvalues and Eigenvectors of a square matrix using SciPy?

Gaurav Kumar

Gaurav Kumar

Updated on 14-Dec-2021 11:09:15

We can find the Eigenvalues and Eigenvectors for a square matrix, say A, with the help of following relation −SciPy library has scipy.linalg.eig() function for computing the eigenvalues and eigenvectors of a square matrix.Let’s understand how we can use this function to calculate the inverse of a matrix −ExampleEigenvalues and ... Read More

Calculating the Minkowski distance using SciPy

Gaurav Kumar

Gaurav Kumar

Updated on 14-Dec-2021 10:38:44

The Minkowski distance, a generalized form of Euclidean and Manhattan distance, is the distance between two points. It is mostly used for distance similarity of vectors. Below is the generalized formula to calculate Minkowski distance in n-dimensional space −$$\mathrm{D= \big[\sum_{i=1}^{n}|r_i-s_i|^p\big]^{1/p}}$$Here, si and ri are data points.n denotes the n-space.p represents ... Read More

Calculating the Manhattan distance using SciPy

Gaurav Kumar

Gaurav Kumar

Updated on 14-Dec-2021 10:24:49

The Manhattan distance, also known as the City Block distance, is calculated as the sum of absolute differences between the two vectors. It is mostly used for the vectors that describe objects on a uniform grid such as a city block or chessboard. Below is the generalized formula to calculate ... Read More

Calculating Euclidean distance using SciPy

Gaurav Kumar

Gaurav Kumar

Updated on 14-Dec-2021 10:24:02

Euclidean distance is the distance between two real-valued vectors. Mostly we use it to calculate the distance between two rows of data having numerical values (floating or integer values). Below is the formula to calculate Euclidean distance −$$\mathrm{d(r, s) =\sqrt{\sum_{i=1}^{n}(s_i-r_i)^2} }$$Here, r and s are the two points in Euclidean ... Read More

Advertisements