About the scipy lecture notes

Release: 2022.1

https://zenodo.org/badge/doi/10.5281/zenodo.594102.svg

Authors

Editors

  • Gaël Varoquaux
  • Emmanuelle Gouillart
  • Olav Vahtras
  • Pierre de Buyl

Chapter authors

Listed by alphabetical order.

  • Christopher Burns
  • Adrian Chauve
  • Robert Cimrman
  • Christophe Combelles
  • André Espaze
  • Emmanuelle Gouillart
  • Mike Müller
  • Fabian Pedregosa
  • Didrik Pinte
  • Nicolas Rougier
  • Gaël Varoquaux
  • Pauli Virtanen
  • Zbigniew Jędrzejewski-Szmek
  • Valentin Haenel (editor from 2011 to 2015)

Additional Contributions

Listed by alphabetical order

  • Osayd Abdu
  • arunpersaud
  • Ross Barnowski
  • Sebastian Berg
  • Lilian Besson
  • Matthieu Boileau
  • Joris Van den Bossche
  • Michael Boyle
  • Matthew Brett
  • BSGalvan
  • Lars Buitinck
  • Pierre de Buyl
  • Ozan Çağlayan
  • Lawrence Chan
  • Adrien Chauve
  • Robert Cimrman
  • Christophe Combelles
  • David Cournapeau
  • Dave
  • dogacan dugmeci
  • Török Edwin
  • egens
  • Andre Espaze
  • André Espaze
  • Loïc Estève
  • Corey Farwell
  • Tim Gates
  • Stuart Geiger
  • Olivier Georg
  • Daniel Gerigk
  • Robert Gieseke
  • Philip Gillißen
  • Ralf Gommers
  • Emmanuelle Gouillart
  • Julia Gustavsen
  • Omar Gutiérrez
  • Valentin Haenel
  • Pierre Haessig
  • Bruno Hanzen
  • Michael Hartmann
  • Jonathan Helmus
  • Andreas Hilboll
  • Himanshu
  • Julian Hofer
  • Tim Hoffmann
    1. Hohl
  • Tarek Hoteit
  • Gert-Ludwig Ingold
  • Zbigniew Jędrzejewski-Szmek
  • Thouis (Ray) Jones
  • jorgeprietoarranz
  • josephsalmon
  • Greg Kiar
  • kikocorreoso
  • Vince Knight
  • LFP6
  • Manuel López-Ibáñez
  • Marco Mangan
  • Nicola Masarone
  • John McLaughlin
  • mhemantha
  • michelemaroni89
  • Mohammad
  • Zachary Moon
  • Mike Mueller
  • negm
  • John B Nelson
  • nicoguaro
  • Sergio Oller
  • Theofilos Papapanagiotou
  • patniharshit
  • Fabian Pedregosa
  • Philippe Pepiot
  • Tiago M. D. Pereira
  • Nicolas Pettiaux
  • Didrik Pinte
  • Evgeny Pogrebnyak
  • reverland
  • Maximilien Riehl
  • Kristian Rother
  • Nicolas P. Rougier
  • Nicolas Rougier
  • Rutzmoser
  • Sander
  • João Felipe Santos
  • Mark Setchell
  • Helen Sherwood-Taylor
  • Shoeboxam
  • Simon
  • solarjoe
  • ssmiller
  • Scott Staniewicz
  • strpeter
  • surfer190
  • Bartosz Telenczuk
  • tommyod
  • Wes Turner
  • Akihiro Uchida
  • Utkarsh Upadhyay
  • Olav Vahtras
  • Gael Varoquaux
  • Nelle Varoquaux
  • Olivier Verdier
  • VirgileFritsch
  • Pauli Virtanen
  • Yosh Wakeham
  • Stefan van der Walt
  • yasutomo57jp

What’s new

Release 2022.1 (August 2022)

  • Replace scikit-learn housing example with California data (Marco Mangan)
  • Fix links and typos (Zachary Moon, Tim Gates, Marco Mangan, Gert-Ludwig Ingold)
  • Fix fftpack figure (Osayd Abdu)
  • Update software version (Pierre de Buyl)

Release 2020.2 (September 2020)

  • Replace image i/o from scipy.misc by imageio (Pierre de Buyl)
  • Update information on dict ordering (Bharath Saiguhan)
  • Suppress warnings for mandelbrot example (Pierre de Buyl)
  • Update NumPy introduction and advanced usage for changes to NumPy: wording, bytes representation, floating point argument to np.zeros (Ross Barnowski)
  • Fix links to NumPy documentation to use numpy.org (Ross Barnowski)
  • Update note on transposed arrays (Ross Barnowski with Eric Wieser)
  • Use generated figure file for lidar data processing (Lawrence Chan)
  • Update link from PyMC2 to PyMC3 (B. Hohl)
  • Fix transparent popup menu to have a background (Pierre de Buyl)

Release 2020.1 (March 2020)

  • Fix outdated URLs (Gert-Ludwig Ingold)
  • Update packages (Pierre de Buyl)
  • Remove Python 2 continous integration (Olav Vahtras - EuroSciPy 2019 sprint)
  • Fix chessboard size (Mark Setchell)
  • Add objectives and design choices (Gert-Ludwig Ingold and Pierre de Buyl)
  • Make the numpy advanced iterator example more elaborate (Sebastian Berg)
  • Use empty list instead of empty tuple to deactivate ticks (Tim Hoffmann)
  • Fix typos (Sander van Rijn, cydave, Michel Corne) and off by 2 errors (Andreas Hilboll)
  • Improve readability of Polynomials example code (Michel Corne)
  • Replace suggestions for debugging environments (Gert-Ludwig Ingold)
  • Add section on Python 2 vs Python 3 (Pierre de Buyl)

Release 2019.1 (May 2019)

  • Update matplotlib compatibility to version 2.2 (Mike Mueller, Joris Van den Bossche, Pierre de Buyl)
  • Make C-API example cos_module_np Python 2/3 compatible (Michael Boyle)
  • Fix typos and outdated URLs (Dogacan Dugmeci, Matthieu Boileau, Stuart Geiger, Omar Gutiérrez, Himanshu, Julian Hofer, Joseph Salmon, Manuel López-Ibáñez, Nicola Masarone, michelemaroni89, Evgeny Pogrebnyak, tommyod)

Release 2018.1 (September 2018)

  • Fix wordings, typos, colours (Pierre de Buyl, Greg Kiar, Olav Vahtras Kristian Rother)
  • Fix interpolation example code (Scott Staniewicz)
  • Fix CSS for high density displays (Gaël Varoquaux)
  • Generate indexing figures with PyX (Gert Ingold)
  • Warn clearly against the use of Python 2 (Bruno Hanzen)
  • Update external links (Bruno Hanzen)
  • Update versions of dependencies: sphinx-gallery, pandas, statsmodels (Gaël Varoquaux)

Release 2017.1 (October 2017)

  • Update optimization chapter (Michael Hartmann, Gaël Varoquaux)
  • Update SymPy chapter (Vince Knight)
  • Update advanced NumPy (Bartosz Teleńczuk)
  • Update scikit-learn chapter (Gaël Varoquaux)
  • Update SciPy chapter (Gaël Varoquaux)
  • Make ‘>>>’ in the prompts unselectable (Pierre de Buyl)
  • Use common package requirements for pip and conda and improve the build instructions (Gert-Ludwig Ingold, Vince Knight, Pierre de Buyl)
  • Set up Circle CI (Loïc Estève)
  • Improved support for Python 3 integer divisions and calls to print (Loïc Estève, Gert-Ludwig Ingold, Pierre de Buyl, Gaël Varoquaux)
  • Change test runner to pytest (Pierre de Buyl)
  • Replace the plot directive by sphinx-gallery (Gert-Ludwig Ingold)

Release 2016.1 (September 2016)

  • Rework of intro chapter (Gaël Varoquaux)
  • Integrate sphinx-gallery: examples are now Jupyter notebooks (Gaël Varoquaux, Gert-Ludwig Ingold, Óscar Nájera)
  • Better Python 3 tests and support (Gert-Ludwig Ingold)
  • Adapt examples to Matplotlib 1.5 (Gaël Varoquaux)
  • Modernize numpy chapter (Bartosz Telenczuk)

Release 2015.3 (November 2015)

  • Collapsed sidebar can now pop up for mid-sized display (Gaël Varoquaux)
  • Replaced pictures of Lena by racoon face (Thouis Jones)

Release 2015.2 (October 2015)

  • Authors on cover ordered as in bibtex entry (Nicolas Rougier)
  • Better rendering on mobile (Gaël Varoquaux)
  • Fix restructured text markup errors (Olav Vahtras)

Release 2015.1 (September 2015)

  • New chapter on statistics with Python (Gaël Varoquaux)
  • Better layout in PDF (Gaël Varoquaux)
  • New HTML layout, simplified formatting, mobile-friendly and sidebar (Gaël Varoquaux, Nelle Varoquaux)
  • Logos on the HTML front page and on the PDF cover (Nicolas Rougier)
  • Python 3 compatible code (Gaël Varoquaux, Olav Vahtras)
  • Code put up to date for more recent versions of project (Pierre de Buyl, Emmanuelle Gouillart, Gert-Ludwig Ingold, Nicolas Pettiaux, Olav Vahtras, Gaël Varoquaux, Nelle Varoquaux)
  • Matplotlib updated with removal of deprecated pylab interface (Nicolas Rougier)

Release 2013.2 (21 August 2013)

  • Numpy chapter simplified (Valentin Haenel)
  • New layout for the HTML rendering (Gaël Varoquaux)

Release 2013.1 (10 Feb 2013)

  • Improvements to the advanced image manipulation chapter (Emmanuelle Gouillart)
  • Upgrade of the introductory language chapter (Valentin Haenel)
  • Upgrade of the introductory numpy chapter (Valentin Haenel)
  • New advanced chapter on interfacing with C (Valentin Haenel)
  • Minor fixes and improvements in various places (Robert Gieseke, Ozan Çağlayan, Sergio Oller, kikocorreo, Valentin Haenel)

Release 2012.3 (26 Nov 2012)

This release integrates the changes written for the Euroscipy conference:

  • Matplotlib chapter completely redone (Nicolas Rougier, Gaël Varoquaux)
  • New advanced chapter on mathematical optimization (Gaël Varoquaux)
  • Mayavi chapter redone (Gaël Varoquaux)
  • Front page layout slightly improved: folding TOC (Gaël Varoquaux)

Release 2012.2 (22 Jun 2012)

Minor release with a few clean ups (Gael Varoquaux).

Release 2012.1 (20 Jun 2012)

This is a minor release with many clean ups. In particular, clean up of the layout (Gael Varoquaux), shortening of the numpy chapters and deduplications across the intro and advanced chapters (Gael Varoquaux) and doctesting of all the code (Gael Varoquaux).

Release 2012.0 (22 Apr 2012)

This is a minor release with a few clean ups. In particular, clean up the scikit-learn chapter (Lars Buitinck), more informative section titles (Gael Varoquaux), and misc fixes (Valentin Haenel, Virgile Fritsch).

Release 2011.1 (16 Oct 2011)

This release is a reworked version of the Euroscipy 2011 tutorial. Layout has been cleaned and optimized (Valentin Haenel and many others), the Traits chapter has been merged in (Didrik Pinte)

Release 2011 (1 Sept 2011)

This release is used for the Euroscipy 2011 tutorial. The numpy introductory chapter has been rewamped (Pauli Virtanen). The outline of the introductory chapters has been simplified (Gaël Varoquaux). Advanced chapters have been added: advanced Python constructs (Zbigniew Jędrzejewski-Szmek), debugging code (Gaël Varoquaux), optimizing code (Gaël Varoquaux), image processing (Emmanuelle Gouillart), scikit-learn (Fabian Pedregosa).

License

All code and material is licensed under a

Creative Commons Attribution 4.0 International License (CC-by)

http://creativecommons.org/licenses/by/4.0/

See the AUTHORS.rst file for a list of contributors.

Contributing

The SciPy lecture notes are a community-based effort and require constant maintenance and improvements. New contributions such as wording improvements or inclusion of new topics are welcome.

To propose bugfixes or straightforward improvements to the notes, see the contribution guide below.

For new topics, read the objectives first and open an issue on the GitHub project to discuss it with the editors.

Objectives and design choices for the lecture notes

Contributors should keep the following objectives and design choices of the SciPy lecture notes in mind.

Objectives:

  • Provide a self-contained introduction to Python and its primary computational packages, the ”SciPy stack“.
  • Provide tutorials for a selection of widely-used and stable computational libraries. Currently, we cover pandas, statmodels, seaborn, scikit-image, scikit-learn, sympy, and mayavi.
  • Automated testing is applied to the code examples as much as possible.

Design choices:

  • Each chapter should provide a useful basis for a 1‒2 h tutorial.
  • The code should be readable.
  • An idomatic style should be followed, e.g. import numpy as np, preference for array operations, PEP8 coding conventions.

Building instructions

To generate the html output for on-screen display, Type:

make html

the generated html files can be found in build/html

The first build takes a long time, but information is cached and subsequent builds will be faster.

To generate the pdf file for printing:

make pdf

The pdf builder is a bit difficult and you might have some TeX errors. Tweaking the layout in the *.rst files is usually enough to work around these problems.

Requirements

A complete list of requirements with information on the versions presently used to build the SciPy lecture notes, can be inferred from the requirements file:

numpy>=1.13,<1.17
scipy==0.19.1
scikit-learn==0.23
matplotlib>=2.0,<3.0
scikit-image>=0.14,<0.15
sympy>=1.2
statsmodels==0.8
seaborn==0.8
pandas==0.23
pytest>=5.1
sphinx>=1.7,<1.8
coverage==4.4.2
pillow
imageio>=2.8
pip
# For conda, pip installable
sphinx-gallery==0.2.0

The installation instructions below cover (i) Debian/Ubuntu with miniconda as this is the method we use to test and build the material and (ii) generic instructions using pip.

Building on Debian/Ubuntu

The environment needed to create an html version of the SciPy lecture notes can be based on miniconda. We first download the latest version of miniconda and rename it to miniconda.sh for simplicity:

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh

To ensure that the file has been downloaded correctly, one can compare the MD5 sum obtained by means of:

md5sum miniconda.sh

with the value listed on https://repo.continuum.io/miniconda/ . Miniconda can now be installed:

bash miniconda.sh

Review the license agreement and choose a target directory (here we assume it to be $HOME/miniconda3). Unless you intend to work more extensively with miniconda, you do not want to modify .bashrc. In this case, you need:

export PATH=$HOME/miniconda3/bin:$PATH

to find the correct binaries. Note that the path depends on the target directory chosen above.

Now, we use environment.yml from the main directory of the scipy-lecture-notes repository to install the required dependencies. Note that environment.yml yields an environment named testenv. If you prefer a more telling name, make a copy of environment.yml, replace testenv in line 4 by a more appropriate name and use this name in the following instead of testenv. The conda environment is created by:

conda env create -f environment.yml

Now, the environment can be activated:

source activate testenv

and deactivated:

source deactivate

With an activated environment, you are now able to produce the html version of the SciPy as explained above. Generating a pdf version requires the system packages texlive, texlive-latex-extra, texlive-fonts-extra, and latexmk.

Installing the Python packages with pip

pip is the recommended tool to install Python packages. However, a number of packages must be installed from the system. Install Python, the Python “headers” (the python3-dev package on Debian, for instance), a C development environment, GNU Make, a full LaTeX distribution (e.g. TeX Live with extra fonts and utilities) and git.

The remaining software can be installed with pip. Depending on the configuration, the probably most convenient and safe way to proceed is with:

pip install --user -r requirements.txt

This will install the software in a local directory belonging to the user and will not interfere with system-wide Python packages.