Welcome. SciPy Central is a collection of code snippets, modules and links for solving scientific problems with SciPy and related Python tools.

Matplotlib tutorial
Matplotlib is probably the single most used Python package for 2Dgraphics. It provides both a very quick way to visualize data from Python and publicationquality figures in many formats. We ...
 0
 by Nicolas Rougier
 on 29 September 2015

SciPy Lectures Notes
These are a consistent set of materials to learn the core aspects of the scientific Python ecosystem, from beginner to expert. They are written and maintained by a set of ...
 0
 by Nicolas Rougier
 on 28 September 2015

Ten simple rules for better figures
This link to the sources of the figures of the article “Ten Simple Rules for better figures”, Nicolas P. Rougier, Michael Droettboom, Philip E. Bourne, PLOS Computational Biology, 2014. Article ...
 0
 by Nicolas Rougier
 on 28 September 2015

100 Numpy exercices
A collection of 100 numpy exercices gathered from the numpy mailing list, stack overflow and other places.
 0
 revision 2
 by Nicolas Rougier
 on 28 September 2015

Learning Scipy
This repository contains source code programs and some notes to complement the book about the scientific Python module SciPy entitle [Learning SciPy for Numerical and Scientific Computing  Second Edition (2015 ...

numpygroupies
Optimised tools for groupindexing operations: aggregated sum and more. aggregate(group_idx, a, func=’sum’):

NumPy / SciPy Recipes for Data Science: Kernel Least Squares Optimization (1)
In this note, we show that least squares optimization is amenable to the kernel trick. This provides great flexibility in model fitting and we consider examples that illustrate this. In ...
 0
 by christianbauckhage
 on 03 April 2015

Simple interactive Matplotlib plots
Interactive graphs with Matplotlib have haunted me. So here I have collected a number of tricks that should make interactive use of plots simpler. The functions below show how to ...
 0
 by thomas.haslwanter
 on 30 March 2015

NumPy / SciPy Recipes for Data Science: Squared Euclidean Distance Matrices
In this note, we explore and evaluate various ways of computing squared Euclidean distance matrices (EDMs) using NumPy or SciPy. In particular, we discuss 6 increasingly abstract code snippets where ...
 0
 by christianbauckhage
 on 22 March 2015

NumPy / SciPy Recipes for Data Science: kMedoids Clustering
In this note, we study kmedoids clustering and show how to implement the algorithm using NumPy. To illustrate potential and practical use of this lesser known clustering method, we discuss ...
 0
 by christianbauckhage
 on 22 March 2015

Building a simple interactive 2ddata viewer with Matplotlib
This is a very simple, but practical 2ddata viewer, which uses only matplotlib widgets. Click: on the image or the plots to get a cross section  x or y depending ...
 0
 revision 5
 by lissacoffey
 on 08 April 2015

Basic linear regression
Expected result: See the official Scipy documentation for details about
linregress
. A more complete regression model can be obtained here with the OLS function in the statsmodels library. 0
 revision 4
 by lissacoffey
 on 22 May 2015

pymls  solving bounded linear least squares problems
Based on mls_alloc from the matlab toolbox Qcat by Ola Harkegard, this package allows to solve bounded least squares problems. It is also possible to put weights on your columns ...

Principal components analysis (PCA) using a sequential method
The singular value decomposition is usually presented as the way to calculate the PCA decomposition of a data matrix. The NIPALS algorithm is a very computationally tractable way of calculating ...

Integrating an initial value problem (single ODE)
We want to integrate a single equation \(\displaystyle \frac{dy(t)}{dt} = f(t, y)\) with a given initial condition \(y(t=0)=y_0\). There are several integrators available in ...
 0
 revision 3
 by SciPy Central
 on 06 August 2011

Find the points at which two given functions intersect
The code considers the case of finding the intersection of a polynomial, \(y=x^2\) and a line, \(y=x+1\). Write these functions in the form \(\mathbf{f(x ...
 0
 revision 3
 by lissacoffey
 on 08 April 2015

Fitting a Gaussian to noisy datapoints
This script reproduces the plots from
Guo, A Simple Algorithm for Fitting a Gaussian Function, IEEE Signal Processing Magazine, September 2011, pp. 134–137.

Python tools for oceanographic analysis
A collaborative effort to organize Python tools for the Oceanographic Community.

SfePy (simple finite elements in Python)
SfePy is a software for solving systems of coupled partial differential equations (PDEs) by the finite element method in 2D and 3D. It can be viewed both as blackbox PDE ...
 0
 by robert.cimrman
 on 08 September 2011

Using Prony's method to fit a sum of exponentials
This a basic implementation of Prony’s method. In this form, it is very susceptible to noise. Added by Jose: I had some problems using “lstsq” from scipy.linalg that ...