PHY224 Python Review

This website covers the material in the Python Review section of the PHY224 course at the University of Toronto This lesson references the Jupyter Notebook, but can be taught using a regular Python interpreter or Spyder as well.


  1. Students should have Python installed before the class starts. The easiest method for most people is using the Anaconda Python distribution. Please see the setup instructions for details.

  2. Students should read the Python materials on Quercas.

  3. Students should download the data files and ipython notebooks if they want to follow along, or work independently


Setup Download files required for the lesson
00:00 1. Running and Quitting How can I run Python programs?
00:10 2. Variables and Assignment How can I store data in programs?
00:30 3. Data Types and Type Conversion What kinds of data do programs store?
How can I convert one type to another?
00:40 4. Built-in Functions and Help How can I use built-in functions?
How can I find out what they do?
What kind of errors can occur in programs?
01:05 5. Libraries How can I use software that other people have written?
How can I find out what that software does?
01:25 6. Numpy and Scipy How do I deal with tabular scientific data?
02:15 7. Reading Tabular Data into arrays How can I read tabular data?
How can I save tabular data?
02:35 8. Plotting How can I plot my data?
How can I save my plot for publishing?
03:15 9. Lists How can I store multiple values?
03:35 10. For Loops How can I make a program do many things?
04:00 11. Looping Over Data Sets How can I process many data sets with a single command?
04:05 12. Writing Functions How can I create my own functions?
04:30 13. Variable Scope How do function calls actually work?
How can I determine where errors occurred?
04:50 14. Conditionals How can programs do different things for different data?
05:15 15. Programming Style How can I make my programs more readable?
How do most programmers format their code?
How can programs check their own operation?
05:30 16. Fitting data to models How do I fit my data to a scientific model.
06:30 17. Wrap-Up What have we learned?
What else is out there and where do I find it?
06:30 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.