SciPy

Python Scipy signal.find_peaks() — A Helpful Guide

This article deals with the analysis and processing of signals, more specifically on how to identify and calculate the peaks contained in a given signal. Motivation Being able to identify and hence work with the peaks of a signal is of fundamental importance in lots of different fields, from electronics to data science and economics. …

Python Scipy signal.find_peaks() — A Helpful Guide Read More »

Fitting Data With Scipy’s UnivariateSpline() and LSQUnivariateSpline()

This article explores the use of the functions .UnivariateSpline() and .LSQUnivariateSpline(), from the Scipy package. What Are Splines? Splines are mathematical functions that describe an ensemble of polynomials which are interconnected with each other in specific points called the knots of the spline. They’re used to interpolate a set of data points with a function …

Fitting Data With Scipy’s UnivariateSpline() and LSQUnivariateSpline() Read More »

Scipy Interpolate 1D, 2D, and 3D

In this article we will explore how to perform interpolations in Python, using the Scipy library. Scipy provides a lot of useful functions which allows for mathematical processing and optimization of the data analysis. More specifically, speaking about interpolating data, it provides some useful functions for obtaining a rapid and accurate interpolation, starting from a …

Scipy Interpolate 1D, 2D, and 3D Read More »

Exponential Fit with SciPy’s curve_fit()

In this article, you’ll explore how to generate exponential fits by exploiting the curve_fit() function from the Scipy library. SciPy’s curve_fit() allows building custom fit functions with which we can describe data points that follow an exponential trend. In the first part of the article, the curve_fit() function is used to fit the exponential trend …

Exponential Fit with SciPy’s curve_fit() Read More »

Calculating Entropy with SciPy

Problem: How to calculate the entropy with the SciPy library? Solution: Import the entropy() function from the scipy.stats module and pass the probability and the base of the logarithm into it. Try It Yourself: Run this code in the interactive code shell! Exercise: Change the probabilities. How does the entropy change? Let’s start slowly! You’ll …

Calculating Entropy with SciPy Read More »