Commit 046828c7 authored by Ben Glocker's avatar Ben Glocker
Browse files

renamed intro notebook

parent aacb7519
%% Cell type:markdown id: tags:
# Introduction to Python for Algorithms 202
# Introduction to Python (for Algorithms 2)
%% Cell type:markdown id: tags:
by *James Booth* and *Ghislain Antony Vaillant*
......@@ -14,41 +14,10 @@
This notebook is by no means a comprehensive introduction to the Python programming language. It covers the essential language features required to implement, test and validate the Algorithms 202 courseworks. It is strongly advised to complement this tutorial with additional reading such as the [official Python documentation](https://docs.python.org/3/), [Python 101](https://leanpub.com/python_101) or the excellent [Hitchhiker's guide to Python](http://docs.python-guide.org/en/latest/).
%% Cell type:markdown id: tags:
### Getting set up
%% Cell type:markdown id: tags:
To use this notebook, you'll first need to install miniconda. To get set up you can follow the start of the [instructions given here for Windows, OS X, and Linux](http://www.menpo.org/installation/). Only go as far as 'Setting Up A Fresh Environment' then jump back here to install the stuff we need (not menpo).
- Create a Python environment with all the code we need in it
```
> conda create -n algo202 python=3 pip setuptools wheel matplotlib jupyter
```
- Activate the environment. On OS X/Linux, simply run:
```
> source activate algo202
```
on Windows:
```
> activate algo202
```
- Finally install the line_profiler tool (you can read more about that at our [blog post](http://www.menpo.org/blog/2014/05/line_profiler_ipython/))
```
(algo202) > pip install line_profiler
```
- Now we are all set up. In the future you only need to reactivate the environment to get to work. To run this notebook, launch a Jupyter notebook server, and browse to this downloaded file
```
(algo202) > jupyter notebook
```
- To navigate through the notebook, have a look at this [cheatsheet](https://www.cheatography.com/weidadeyue/cheat-sheets/jupyter-notebook/)
%% Cell type:markdown id: tags:
## Language basics
%% Cell type:markdown id: tags:
### Syntax and features
......@@ -518,11 +487,11 @@
#### Experiment
%% Cell type:code id: tags:
``` python
sizes = list(range(1, 1000, 100)) + list(range(1000, 10000, 500))
sizes = list(range(1, 1000, 100)) + list(range(1000, 10000, 1000))
timings = [timed(my_sorted, case) for case in [randlist(size) for size in sizes]]
```
%% Cell type:markdown id: tags:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment