Skip to content
1st Edition of Elegant SciPy (O'Reilly Publishers)
Branch: master
Clone or download
stefanv Merge pull request #345 from jni/bz2
Use bz2 to open counts.txt.bz2 directly
Latest commit 858c35e Mar 18, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.matplotlib Add ability to generate plots from scripts Jul 30, 2015
OReilly_HTMLBook @ 14fdeaa HTMLBook build fixes Feb 9, 2017
_images Add book cover Aug 15, 2016
data Markup fixes to ch8 May 7, 2017
docker Fix Docker image locales Oct 18, 2018
figures Add 300dpi version of NumPy_ndarrays_v2.png May 10, 2017
images Package terminator vision image instead of relying on tutorials repo Sep 24, 2018
markdown Use bz2 to open counts file Mar 18, 2019
notes Move call for code to notes folder Jul 13, 2017
patches Berkeley archive is back up--add patch in case this happens again Apr 1, 2016
script Tweak sliding windows figure May 21, 2017
style Make title small in thinner style May 20, 2017
tools Strip all Jupyter style tags (including those that specify scope) Oct 23, 2018
.boto Add deployment of proof to Google Cloud Storage Apr 1, 2016
.gitignore Ignore node_modules directory Jul 13, 2017
.gitmodules Fix submodule path Apr 24, 2017
.travis.yml Use 3.6 in travis script Mar 15, 2017 Fix various markup issues May 9, 2017 add text of licenses: CC-BY-NC-ND and BSD 3-Clause Aug 12, 2016 add text of licenses: CC-BY-NC-ND and BSD 3-Clause Aug 12, 2016
Makefile Remove counts.txt from Makefile Mar 18, 2019 Update Oct 7, 2018
docker-compose.yml Use latest pypi packages in Docker & wercker builds Oct 23, 2018
environment.yml Allow patch versions of mpl 2.0 Jun 3, 2017
index.html Fully remove redundant appendix build Apr 1, 2016
index.markdown Fully remove redundant appendix build Apr 1, 2016
requirements.txt Require jupytercontrib that works with latest Jupyter Oct 23, 2018
wercker.yml Use latest pypi packages in Docker & wercker builds Oct 23, 2018

Elegant SciPy

Try the live notebooks via MyBinder!

This is the online repository for the book Elegant SciPy, written by Juan Nunez-Iglesias (@jni), Harriet Dashnow (@hdashnow), and Stéfan van der Walt (@stefanv), and published by O'Reilly Media:

Elegant SciPy Cover

Using this book.

The text of the book (inside the markdown folder) is available under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License (see

All code is available under the BSD 3-clause license (see This includes:

  • Python code embedded in the text of the book.
  • Python code inside scripts/.
  • Our Makefile and .yml files.

The authors also encourage educators to use this book in their own classrooms for noncommercial instructional uses (i.e. for slide presentations in a university lecture), provided that there is proper attribution to the O’Reilly edition in each instance.

If you are unsure whether your use falls outside fair use or the permissions given above, contact us at

Pre-built Jupyter notebooks

You can find the pre-compiled Jupyter notebooks corresponding to the latest version of this repo at:

This includes the necessary data in the data folder.

Or, if you are feeling adventurous, you can compile the notebooks yourself by following the instructions below.

Building the IPython notebooks

This book was written in markdown, with notedown and jupyter nbconvert used to build the book. To recreate the book contents, install the dependencies, (see below), then run make all from this directory (assuming you are using Mac OS X or Linux).

For interactive exploration you probably don't want to pre-run all the code, but rather create the notebooks with pre-populated input cells. To do this, run, for example:

notedown --match python /markdown/ch5.markdown --output ch5.ipynb

to build a Jupyter notebook containing Chapter 5, which you can then step through by starting a notebook session in this directory:

jupyter notebook

Installing dependencies

First, we build an isolated environment as not to interrupt any existing setup you may have. This can be done using, e.g., Conda:

  1. Install conda or Anaconda

  2. Build an isolated environment called "elegant-scipy" and install the necessary dependencies:

conda env create --name elegant-scipy -f /path/to/elegant-scipy/environment.yml
  1. Activate the environment with conda activate elegant-scipy (or source activate elegant-scipy if using conda 4.3.x or earlier, or activate elegant-scipy on Windows)


To build the full book on Windows, you will at a minimum need the following additional software:

Building the book on Windows is likely to be challenging because we developed the build process on Mac and Linux. However, you should still be able to create conda environments (see "Installing dependencies", above), and run notedown, to make the Jupyter notebooks (see "Building the IPython notebooks", above).

If you encounter any problems, please raise an issue!

Building the complete book

We are using notedown to convert a markdown file to an IPython notebook, run it, and then convert to html. For ease of use, this is done using a Makefile.

You can use make to build all the chapters:

$ make all

Or to build just an individual chapter, specify the file you wish to create:

$ make html/ch1.html

To generate a zip file containing html of all chapters along with a table of contents (for easy sharing):

$ make zip

Building HTMLBook


  • npm: brew install npm (macOS) or sudo apt-get install npm (Ubuntu/Debian)
  • htmlbook: npm install -g htmlbook
  • blahtexml: brew install blahtexml or sudo apt-get install blahtexml

Then run make htmlbook.

The results can be checked in to

and built at

Building with Docker

  1. Install Docker
  2. Switch to the directory containing this file
  3. Run docker-compose up
You can’t perform that action at this time.