Getting started - A guide to IPython Notebooks

What you will need for this course

In this course you will work with Python as the language to work with, since it allows for fast prototyping and is supported by a great variety of scientific (and, specifically, data related) libraries.

Installing Python

There are many ways to install Python. One way is the free Anaconda Scientific Python distribution, which you can download from https://store.continuum.io/cshop/anaconda/. This Python distribution contains most of the packages that we will be using throughout the course. It also includes an easy-to-use but powerful packagin system, conda. For compabitility reasons, we will be using Python 2.7, so make sure to download the correct version of Anaconda.


IPython Notebook

IPython has become the standard for interactive computing in Python. After installing Anaconda, you can access IPython (and the Notebooks) either through the Anaconda Launcher or the Anaconda command prompt.

To run the IPython Notebook server from the command line, type ipython notebook from the terminal. Your web browser will open and load the environment.

In the notebook, you can type and run code:

In [3]:
print "hi!"
hi!

If you do not want to install iPython launchers

Go to: http://nbviewer.ipython.org/url/ + url where the ipython notebook is located


Conda Package Manager

Anaconda also installs a package manager, that makes it easy to install and update Python packages. To call it, you need to type conda in the Anaconda command prompt. You can read a brief FAQ for conda here.

In [4]:
# Code for setting the style of the notebook
from IPython.core.display import HTML
def css_styling():
    styles = open("theme/custom.css", "r").read()
    return HTML(styles)
css_styling()
Out[4]: