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.
Code used on slides and used for making the figures on the slides can be found in this folder.
Week | Date | Topic | Litterature | Slides & Video | Exercises | |
5 | Monday | 27/1 | Semester starts | |||
Wednesday | 29/1 | Introduction to Python | [G] 1 | introduction.pdf | lecture 1 | |
Friday | 31/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 |
lecture 2 handin 1 |
|
6 | Monday | 3/2 | Exercise classes start | |||
Wednesday | 5/2 |
Basic operations None, bool, basic operations, strings |
[G] 2.3 | operations.pdf | lecture 3 | |
Friday | 7/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 | lecture 4 handin 2 |
|
7 | Wednesday | 12/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 | lecture 5 |
Friday | 14/2 | Dictionaries and sets dict, set, frozenset, dictionary comprehension, set comprehension, collections, deque, namedtuple, Counter |
[G] 5.6 | dictionaries.pdf | lecture 6 handin 3 |
|
8 | Wednesday | 19/2 | Functions functions, return, scoping, arguments, keyword arguments, *, **, global variables |
[G] 4.1, 4.4 | functions.pdf | lecture 7 |
Friday | 21/2 | Recursion symbol table, stack frames |
[G] 4.3 | recursion.pdf | lecture 8 handin 4 |
|
9 | Wednesday | 26/2 | Recursion and iteration algorithm examples |
[G] 3.1, 3.3, 3.4, 3.5, 10.1 | recursion_iteration.pdf | lecture 9 handin 5 |
Friday | 28/2 | Functions as objects lambda, higher-order functions, map, filter, reduce |
[G] 5.4, 10.2 | lambda.pdf | lecture 10 | |
10 | Wednesday | 4/3 | Object oriented programming classes, objects, self, construction, encapsulation |
[G] 8.1, 8.3.0 | classes.pdf | lecture 11 |
Friday | 6/3 | Class hierarchies inheritance, method overriding, super, multiple inheritance |
[G] 8.2 | hierarchies.pdf | lecture 12 handin 6 |
|
11 | Wednesday | 11/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 | lecture 13 |
Friday | 13/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![]() ![]() |
lecture 14 handin 7 |
|
12 | Wednesday | 18/3 | Decorators @, @property, @functools.total_ordering, dataclasses |
decorators.pdf![]() ![]() |
lecture 15 | |
Friday | 20/3 |
Dynamic programming memoization, decorator memoized, systematic subproblem computation |
[G] 13.1, 13.2 | dynamic_programming.pdf![]() ![]() |
lecture 16 handin 8 |
|
13 | Wednesday | 25/3 | Visualization and optimization Matplotlib, Jupyter, scipy.optimize.minimize |
[G] 11 | optimization.pdf![]() ![]() ![]() |
lecture 17 |
Friday | 27/3 | Multi-dimensional data NumPy, matrix multiplication, @, numpy.linalg.solve, numpy.polyfit |
[G] 18 |
numpy.pdf![]() ![]() ![]() |
lecture 18 | |
14 | Wednesday | 1/4 | Linear programming scipy.optimize.linprog |
linear_programming.pdf pagerank.ipynb max-flow.ipynb ![]() ![]() ![]() |
lecture 19 handin 9 |
|
Friday | 3/4 | Generators and iterators yield, __iter__, __next__, measuring memory usage |
[G] 8.3.1 | generator.pdf![]() ![]() ![]() |
lecture 20 handin 10 |
|
15 | Saturday-Monday | 4/4- 13/4 |
Easter break - no teaching | |||
16 | Tuesday | 14/4 | No exercise class | |||
Wednesday | 15/4 | Modules and packages from-import-as, __name__, "__main__", heapq No exercise class |
[G] 4.5 | modules.pdf![]() ![]() |
lecture 21 | |
Thursday | 16/4 | No exercise class | ||||
Friday | 17/4 | Working with text file formats (CSV, Json, XML, Excel), regular expressions (module re), finditer |
text.pdf![]() ![]() ![]() |
lecture 22 | ||
17 | Wednesday | 22/4 | Relational data SQLite, pandas |
pandas.pdf pandas.ipypdf ![]() ![]() |
lecture 23 | |
Friday | 24/4 | Clustering k-means, scipy.cluster.vq.kmeans, neural networks |
[G] 23 | clustering.pdf![]() ![]() |
lecture 24 |
|
18 | Wednesday | 29/4 | Graphical user interfaces (GUI) Tkinter, qt |
gui.pdf![]() |
lecture 25 |
|
Friday | 1/5 | Java vs Python | java.pdf![]() |
lecture 26 | ||
19 | Wednesday | 6/5 | No lecture | |||
Friday | 8/5 | Holiday (General Prayer Day) - no teaching | ||||
20 | Wednesday | 13/5 | Follow up on course evaluation, discussion of exam | final_lecture.pdf | lecture 27 | |
Friday | 15/5 | No lecture Last day of semester |
||||
21 | Sunday | 31/5 | Project deadline 23:59 | |||
22-26 | June | Q & A sessions (TAs and Lecturer) | ||||
Multiple choice exam |