The below course plan contains videos and slides for watching at your own speed.
Code used on slides and used for making the figures on the slides can be found in this folder.
Below [G] refers to the textbook by John V. Guttag, Introduction to Computation and Programming Using Python With Application to Understanding Data, 2nd Edition. 472 pages. MIT Press, 2016. The book is not curriculum in the course.
There will only be live lectures Wednesdays 14:15-16:00 at Zoom covering questions posted on the discussion forum and/or going over some examples/exercises (live coding exercises and solution code).
| Week | Date | Topic | Litterature | Slides & Video | Exercises | |
| 5 | Monday | 1/2 | Semester starts | |||
| Wednesday | 3/2 | Introduction to Python | [G] 1 | introduction.pdf | lecture 1 | |
| Friday | 5/2 |
Python basics variables, int, float, str, type conversion, assignment, print(), help(), type() Control structures if-elif-else, while-break-continue, input() |
[G] 2.1, 2.2, 2.4 |
basics.pdf control.pdf
Basics 55:27
Control 32:09 |
lecture 2 handin 1 |
|
| 6 | Monday | 8/2 | Exercise classes start | |||
| Wednesday | 10/2 |
Basic operations None, bool, basic operations, strings |
[G] 2.3 |
operations.pdf
Operations 1:02:04
|
lecture 3 | |
| Friday | 12/2 |
Lists Syntax, operations, copy.deepcopy Control structures while-else, for-loops, for-break-continue-else, range |
[G] 3.2, 5.2, 5.5 |
lists.pdf
Lists 1:00:04
|
lecture 4 handin 2 |
|
| 7 | Wednesday | 17/2 |
Tuples and lists tuples, lists, mutability, list comprehension, for-if, for-for, list(), any(), all(), enumerate(), zip() |
[G] 5.1, 5.3, 5.5 | tuple.pdf
Tuples 50:13
Orientation test 11:38
|
lecture 5 |
| Friday | 19/2 | Dictionaries and sets dict, set, frozenset, dictionary comprehension, set comprehension, collections, deque, namedtuple, Counter |
[G] 5.6 | dictionaries.pdf
Dictionaries 49:51
Handins 3-4 5:11
|
lecture 6 handin 3 |
|
| 8 | Wednesday | 24/2 | Functions functions, return, scoping, arguments, keyword arguments, *, **, global variables |
[G] 4.1, 4.4 | functions.pdf
Functions 58:04
|
lecture 7 |
| Friday | 26/2 | Recursion symbol table, stack frames |
[G] 4.3 | recursion.pdf
Recursion 46:29
|
lecture 8 handin 4 |
|
| 9 | Wednesday | 3/3 | Recursion and iteration algorithm examples |
[G] 3.1, 3.3, 3.4, 3.5, 10.1 | recursion_iteration.pdf
Recursion and iteration 57:43
|
lecture 9 handin 5 |
| Friday | 5/3 | Functions as objects lambda, higher-order functions, map, filter, reduce |
[G] 5.4, 10.2 | lambda.pdf
Lambda 44:05
|
lecture 10 | |
| 10 | Wednesday | 10/3 | Object oriented programming classes, objects, self, construction, encapsulation |
[G] 8.1, 8.3.0 | classes.pdf
Classes 1:11:42
|
lecture 11 |
| Friday | 12/3 | Class hierarchies inheritance, method overriding, super, multiple inheritance |
[G] 8.2 |
hierarchies.pdf
Class hierarchies 44:20
|
lecture 12 handin 6 |
|
| 11 | Wednesday | 17/3 | Exceptions and file input/output try-raise-except-finally, Exception, control flow, file open/read/write, sys.stdin, sys.stdout, sys.stderr, context manager |
[G] 7.1, 7.2, 4.6 | exceptions.pdf
Exceptions 28:51
Files 20:13
Sudoku 15:45
|
lecture 13 |
| Friday | 19/3 | Documentation, testing and debugging docstring, defensive programming, assert, test driven developement, assertions, testing, unittest, doctest, debugger, static type checking, mypy |
[G] 4.2, 7.3, 6.1, 6.2 |
testing.pdf
Testing 48:44
Mypy 13:32
|
lecture 14 handin 7 |
|
| 12 | Wednesday | 24/3 | Decorators @, @property, @functools.total_ordering, dataclasses |
decorators.pdf
Decorators 54:37
|
lecture 15 | |
| Friday | 26/3 |
Dynamic programming memoization, decorator memoized, systematic subproblem computation |
[G] 13.1, 13.2 | dynamic_programming.pdf
Dynamic programming 56:46
Coding competitions 10:47
|
lecture 16 handin 8 |
|
| 13 | Saturday-Monday | 27/3 -5/4 |
Easter break - no teaching | |||
| 14 | Tuesday | 6/4 | No exercise class | |||
| Wednesday | 7/4 | Visualization and optimization Matplotlib, Jupyter, scipy.optimize.minimize No exercise class |
[G] 11 | optimization.pdf
Matplotlib 1:03:40
Jupyter 26:35
SciPy minimize 29:47
|
lecture 17 | |
| Friday | 9/4 | Multi-dimensional data NumPy, matrix multiplication, @, numpy.linalg.solve, numpy.polyfit |
[G] 18 |
numpy.pdf
Numpy 42:09
Polyfit 6:12
Numpy matplotlib 15:27
|
lecture 18 | |
| 15 | Wednesday | 14/4 | Linear programming scipy.optimize.linprog |
linear_programming.pdf pagerank.ipynb max-flow.ipynb
Linprog 6:19
Maxflow 10:05
Pagerank 22:17 |
lecture 19 handin 9 |
|
| Friday | 16/4 | Generators and iterators yield, __iter__, __next__, measuring memory usage |
[G] 8.3.1 | generator.pdf
Iterators 38:26
Generators 30:04
Memory usage 9:27
|
lecture 20 handin 10 |
|
| 16 | Wednesday | 21/4 | Modules and packages from-import-as, __name__, "__main__", heapq |
[G] 4.5 | modules.pdf
Modules 24:28
Heapq 8:51
|
lecture 21 |
| Friday | 23/4 | Working with text file formats (CSV, Json, XML, Excel), regular expressions (module re), finditer |
text.pdf
File formats 39:47
Regular expressions 17:59
Lindenmeyer systems 14:10
|
lecture 22 | ||
| 17 | Wednesday | 28/4 | Relational data SQLite, pandas |
pandas.pdf pandas.ipypdf
SQLite 29:23
Pandas 34:23
|
lecture 23 | |
| Friday | 30/4 | Holiday (General Prayer Day) - no teaching | ||||
| 18 | Wednesday | 5/5 | Clustering k-means, scipy.cluster.vq.kmeans, DBSCAN, neural networks |
[G] 23 |
clustering.pdf
Clustering 27:25
DBSCAN 11:11
Neural networks 15:56
|
lecture 24 |
| Friday | 7/5 | Graphical user interfaces (GUI) Tkinter, qt |
gui.pdf
Tkinter 50:37
|
lecture 25 |
||
| 19 | Wednesday | 12/5 | Java vs Python | java.pdf
Java 1:03:03
|
lecture 26 | |
| Thursday | 13/5 | Holiday (Ascension Day) - no teaching | ||||
| Friday | 14/5 | No lecture | ||||
| 20 | Wednesday | 19/5 | Follow up on course evaluation, discussion of exam | ipsa21-course-evaluation.pdf | lecture 27 | |
| Friday | 21/5 | No lecture Last day of semester |
||||
| 21 | Monday | 31/5 | Project deadline 23:59 | |||
| June | Q & A sessions (TAs and Lecturer) | |||||
| Exam | ||||||