How to Install SciPy on PyCharm?

SciPy is an open-source Python library for math, science, and engineering. It includes the wildly popular NumPy and Matplotlib libraries. Problem Formulation: Given a PyCharm project. How to install the SciPy library in your project within a virtual environment or globally? Here’s a solution that always works: Open File > Settings > Project from the … 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 … 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 … 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 … 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 … Read more