Exploratory computing with Python

Mark Bakker

Delft University of Technology

View project onGitHub

Python for Exploratory Computing

Lots of books are written on scientific computing, but very few deal with the much more common exploratory computing (a term coined by Fernando Perez), which represents daily tasks of many scientists and engineers that try to solve problems but are not computer scientists. This set of Notebooks is written for scientists and engineers who want to use Python programming for exploratory computing, scripting, data analysis, and visualization. Python makes many of these programming tasks quick, easy, and, probably most importantly, fun.

No prior knowledge of computer programming is assumed. Each Notebook covers a specific topic and includes a number of exercises. The exercises should take less than 4 hours to complete for each Notebook. Answers to the exercises are given at the end of the Notebook. There are two versions of each Notebook: one with and one without output cells. The Notebooks without the output cells are intended for people wanting to learn Python. Running the output cells is part of the learning process. All Notebooks and accompanying data files may be downloaded by clicking on the 'Download .zip file' button to the right. Notebooks with output cells cells have the addition _sol and can be viewed by clicking on the links below.

Notebooks can be run after you install Python and the appropriate packages. The easiest way to do this is to install an installer that includes Python and a set of the most popular packages. The Notebooks listed here are for Python 3.X. They probably run on Python 2. The three main options for Python distributions with-batteries-included are Anaconda (Mac, Windows, Linux), Canopy Express (Mac, Windows, Linux), and PythonXY (Windows). All these Notebooks were developed with Anaconda. After installing Anaconda, start the Navigator and then launch the Jupyter Notebook, which will open the Jupyter Notebook dashboard in your webbrowser (starting in your Documents folder on Windows and your home directory on a Mac). Use the dashboard to surf to the directory where you stored your Notebooks (you can onely surf to lower directories not higher directories) and click on the one you want to open.

Notebooks and accompanying videos

Basics and Plotting — Notebook 1Video

Arrays — Notebook 2Video

For loops and If/Else statements — Notebook 3Video

Functions — Notebook 4Video

Finding the Zeros of a Function — Notebook 5

Systems of linear equations — Notebook 6

Bugs — Notebook 7

Pandas and Time Series — Notebook 8Video (Python 2)

Discrete Random Variables — Notebook 9Video

Continuous Random Variables — Notebook 10Video

Distribution of the Mean and Hypothesis Tests Theorem — Notebook 11Video (Python 2)

Object oriented programming — Notebook 12Video (Python 2)

Regression I — Notebook 13

To be added soon: Regression II, ipywidgets, animations

This work is licensed under a Creative Commons Attribution 4.0 International License.