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 figures on the slides can be found in this folder.
Week | Date | Topic | Litterature | Slides | Exercises | |
5 | Monday | 29/1 | Semester starts | |||
Wednesday | 31/1 | Introduction to Python | [G] 1 | introduction.pdf | lecture 1 | |
Friday | 2/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 | 5/2 | Exercise classes start | |||
Wednesday | 7/2 | Basic operations None, bool, basic operations, strings |
[G] 2.3 | operations.pdf | lecture 3 | |
Friday | 9/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 | 14/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 | 16/2 | Dictionaries and sets | [G] 5.6 | dictionaries.pdf | lecture 6 handin 3 |
|
8 | Wednesday | 21/2 | Functions functions, return, scoping, arguments, keyword arguments, *, **, global variables |
[G] 4.1, 4.4 | functions.pdf | lecture 7 |
Friday | 23/2 | Recursion symbol table, stack frames |
[G] 4.3 | recursion.pdf | lecture 8 handin 4 |
|
9 | Wednesday | 28/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 | 2/3 | Functions as objects lambda, higher-order functions, map, filter, reduce |
[G] 5.4, 10.2 | lambda.pdf | lecture 10 | |
10 | Wednesday | 7/3 | Object oriented programming classes, objects, self, construction, encapsulation |
[G] 8.1, 8.3.0 | classes.pdf | lecture 11 |
Friday | 9/3 | Class hierarchies inheritance, method overriding, super, multiple inheritance |
[G] 8.2 | hierarchies.pdf | lecture 12 handin 6 |
|
11 | Wednesday | 14/3 | Exceptions and file input/output try-raise-except-finally, Exception, control flow, file open/read/write, sys.stdin, sys.stdout, sys.stderr |
[G] 7.1, 7.2, 4.6 | exceptions.pdf | lecture 13 |
Friday | 16/3 | Documentation, testing and debugging docstring, defensive programming, assert, test driven developement, assertions, testing, unittest, doctest, debugger |
[G] 4.2, 7.3, 6.1, 6.2 | testing.pdf | lecture 14 handin 7 |
|
12 | Wednesday | 21/3 | Decorators @ |
decorators.pdf | lecture 15 | |
Friday | 23/3 | Dynamic programming memoization, decorator memoized, systematic subproblem computation |
[G] 13.1, 13.2 | dynamic_programming.pdf | lecture 16 handin 8 |
|
13 | Saturday-Monday | 24/3-2/4 | Easter break - no teaching | |||
14 | Tuesday | 3/4 | No exercise class (Hold 3) | |||
Wednesday | 4/4 | Visualization and optimization Jupyter, Matplotlib, scipy.optimize.minimize |
[G] 11 | optimization.pdf | lecture 17 | |
Friday | 6/4 | Multi-dimensional data NumPy, matrix multiplication, @, numpy.linalg.solve, numpy.polyfit |
[G] 18 | numpy.pdf | lecture 18 | |
15 | Wednesday | 11/4 | Linear programming scipy.optimize.linprog |
linear_programming.pdf pagerank.sheet pagerank.ipynb max-flow.ipynb |
lecture 19 handin 9 |
|
Friday | 13/4 | Generators, iterators, and context managers yield, __iter__, __next__, with-as and decorators |
[G] 8.3.1 | generator.pdf | lecture 20 handin 10 |
|
16 | Wednesday | 18/4 | Modules and packages import-from-as, __name__, "__main__" |
[G] 4.5 | modules.pdf | lecture 21 |
Friday | 20/4 | Working with text file formats (CSV, Json, XML, Excel), regular expressions (module re), finditer |
text.pdf | lecture 22 | ||
17 | Wednesday | 25/4 | Relational data pandas, SQLite |
pandas.pdf | lecture 23 | |
Friday | 27/4 | Holiday (General Prayer Day) - no teaching | ||||
18 | Wednesday | 2/5 | Clustering k-means, scipy.cluster.vq.kmeans |
[G] 23 | clustering.pdf | lecture 24 |
Friday | 4/5 | Kapsejladsen - no lecture | ||||
19 | Wednesday | 9/5 | Graphical user interfaces (GUI) Tkinter, qt |
gui.pdf | lecture 25 |
|
Thursday | 10/5 | Holiday (Ascension Day) - no teaching | ||||
Friday | 11/5 | Java vs Python | java.pdf | lecture 26 |
||
20 | Wednesday | 16/5 | Follow up on course evaluation and discussion of exam | lecture 27 | ||
Friday | 18/5 | Last day of semester - no lecture | ||||
21 | Monday | 1/6 | Project deadline 23:59 | |||
22-26 | June | Q & A sessions (TAs and Lecturer) | ||||
Multiple choice exam |