EuroSciPy 2014 IPython Advanced Tutorial
- When? August 27th, 9-10.30
- Where? IfM, Cambridge University, UK
- Chat room (asking questions, requesting help, etc.)
Introducing the interactive features of the IPython 2.0 Notebook.
Most of the code examples come from the IPython Cookbook, Packt Publishing, featuring high-performance interactive computing methods for data science and mathematical modeling.
Requirements
Simpler option is to install Anaconda.
- Python 2.7 or Python >= 3.3
- IPython 2.2 (This has been written with the latest stable version, released in August. Some tweaking might be necessary if you use the development version 3.0.0.dev)
- NumPy
- matplotlib
- scikit-learn (part 2)
- mpld3 (part 4,
pip install mpld3
) - networkX (part 4,
pip install networkx
) - a recent browser:
- Chrome >= 13
- Safari >= 5
- Firefox >= 6
Installation
git clone https://github.com/rossant/euroscipy2014.git
cd euroscipy2014
ipython notebook --profile=euroscipy2014
Contents
In this tutorial, we illustrate different features and APIs for creating interactive widgets and visualizations in the IPython notebook.
Calling your Python functions with graphical controls
1.We show how to use the @interact
decorator to create simple GUI controlling Python functions in real time.
Creating a GUI in the notebook
2.Elaborating on the previous example, we show how to create a more complex GUI with custom positioning, styling, and logic. The entire GUI is implemented in Python: there is no JavaScript code to write at this point.
Creating a custom notebook widget with backbone.js
3.In this part, we create an entirely custom widget with HTML, JavaScript, and backbone.js. We show how custom widgets can be designed to play well with the rest of the widget machinery.
Interactive data visualization in the notebook
4.In this part, we explore several interactive data visualization solutions in the notebook, mostly based on the d3.js JavaScript library. We first show how to easily make matplotlib figures interactive in the notebook with mpld3.
Then, we introduce the very basics of d3.js, and we show how to render a networkX graph dynamically in the notebook. There is some JavaScript code to write here.