1st Edition of Elegant SciPy (O'Reilly Publishers)
Clone or download
stefanv Merge pull request #326 from jni/pandas-index-fix
Select genes by name instead of numerical index
Latest commit ad45b04 May 16, 2018
Permalink
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 Add blahtexml to Docker Apr 24, 2017
figures Add 300dpi version of NumPy_ndarrays_v2.png May 10, 2017
images Replace audio control output by a suitable image May 9, 2017
markdown Merge pull request #326 from jni/pandas-index-fix May 16, 2018
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 Use relative instead of abspath for linking Sep 15, 2017
.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
CONTRIBUTING.md Fix various markup issues May 9, 2017
LICENSE-CODE.md add text of licenses: CC-BY-NC-ND and BSD 3-Clause Aug 12, 2016
LICENSE.md add text of licenses: CC-BY-NC-ND and BSD 3-Clause Aug 12, 2016
Makefile Make sure html and nb are dependent on build dirs Sep 15, 2017
README.md Add quick link to binder notebooks Feb 13, 2018
docker-compose.yml Yield to Juan's Conda demands & add Docker section. May 5, 2016
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 Remove outdated seaborn dependency Apr 24, 2017
wercker.yml Use en_US.UTF-8 locale for Wercker builds Apr 24, 2017

README.md

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 LICENSE.md).

All code is available under the BSD 3-clause license (see LICENSE-CODE.md). 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 permissions@oreilly.com.

Pre-built Jupyter notebooks

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

https://github.com/elegant-scipy/notebooks

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/environment.yml

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

Install:

  • 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

git@git.atlas.oreilly.com:oreillymedia/elegant-scipy.git

and built at https://atlas.oreilly.com/oreillymedia/elegant-scipy

Building with Docker

  1. Install Docker
  2. Switch to the directory containing this file
  3. Run docker-compose up