Getting started with Python

You should be comfortable with the material in Python videos 1 and 2 prior to lecture 3, and you should be comfortable with videos 3 and 4 prior to lecture 4. Each video has a few short accompanying exercises for self-assessment of “comfort.”

Note: choose Camera 2 to see the output from my laptop when watching the videos.


1. Copies of the slides and exercises are included in the course bitbucket repository. Look in the python directory in your fork or clone of the python_intro repo.

2. The exercises are ipython notebooks (aka jupyter notebooks). To open them, first download the files (or find them in your clone of python_intro) and then you can open the file from within Canopy or Anaconda navigator. Alternatively, from a Unix terminal, just run:

$ jupyter notebook filename.ipynb

3. Further resources on Python:

Official Python tutorial Sections 3 and 4 complement Python videos 1 and 2.

Official Numpy reference See in particular the section on Routines, and the subsections on Random sampling, Mathematical functions, and Searching, sorting, and counting.

Software carpentry

A Primer on Scientific Programming with Python by H.P. Langtangen: A comprehensive textbook on programming and scientific computing with Python