Andrea Ridolfi

How to Plot Matplotlib’s Color Palette — and Choose Your Plot Color?

In this article, we’ll learn how to generate the matplotlib color palette and then we will use it to select a specific color for our plot. When presenting data, the color that you assign to a plot is very important; a bad color choice can make your data difficult to understand or even less interesting. …

How to Plot Matplotlib’s Color Palette — and Choose Your Plot Color? Read More »

How to Calculate Percentiles in Python

This article deals with calculating percentiles. Percentiles are statistical indicators that are used to describe specific portions of a sample population. The following sections will explain what percentiles are, what they are used for and how to calculate them, using Python. As you will see, Python allows solving this problem in multiple ways, either by …

How to Calculate Percentiles in Python Read More »

Symbolic Math with SymPy: Advanced Functions and Plots

This article will cover some advanced mathematical functions provided by the Sympy library. If you still have not read the first introductory article to Sympy, you can check it out here. Since most of the basic functions, like the ones for initiating a Sympy session on your terminal or for defining a function/variable, will not …

Symbolic Math with SymPy: Advanced Functions and Plots Read More »

Matplotlib Cursor — How to Add a Cursor and Annotate Your Plot

This article explains how to insert a cursor to your plot, how to customize it and how to store the values that you selected on the plot window. In lots of situations we may want to select and store the coordinates of specific points in our graph; is it just for assessing their value or …

Matplotlib Cursor — How to Add a Cursor and Annotate Your Plot Read More »

Matplotlib Widgets — How to Make Your Plot Interactive With Buttons

This article presents different types of widgets that can be embedded within a matplotlib figure, in order to create and personalize highly interactive plots. Exploiting the matplotlib package .widget(), it is hence possible to create personalized buttons that allows controlling different properties of the graphs that are plotted in the main window. This represents a …

Matplotlib Widgets — How to Make Your Plot Interactive With Buttons Read More »

Matplotlib Widgets — Creating Interactive Plots with Sliders

This article describes how to generate interactive plots by using the .widgets package from the matplotlib library. As can be inferred from the name, the .widgets package allows creating different types of interactive buttons, which can be used for modifying what is displayed in a matplotlib graph. In particular, this article will focus on the …

Matplotlib Widgets — Creating Interactive Plots with Sliders Read More »

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 »

Creating Beautiful Heatmaps with Seaborn

Heatmaps are a specific type of plot which exploits the combination of color schemes and numerical values for representing complex and articulated datasets. They are largely used in data science application that involves large numbers, like biology, economics and medicine. In this video we will see how to create a heatmap for representing the total …

Creating Beautiful Heatmaps with Seaborn 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 »