Below is the course plan for the course. For each lecture is stated the topic, the relevant literature, the slides used, videos for watching at your own speed, the exercises connected to the lecture, and handins related to the content of the lecture. The exercises should be covered in the subsequent exercise classes. Due dates for the handins for your exercise class can be found on Brightspace.
All code used on slides and used for making the figures on the slides can be found in this zip file code.zip. All slides concatenated as a single pdf file can be found as all-slides.pdf (also available in the course menu).
[G] refers to optional reading in the textbook by John V. Guttag, Introduction to Computation and Programming Using Python - With Application Computational Modeling and Understanding Data, 3rd Edition. 664 pages. MIT Press, 2021. The book is not curriculum in the course.
Note: Slides and course plan will be updated as the course progresses.
| Week | ||
|---|---|---|
| 5 | Monday January 26 | |
| Semester starts Introduction to Python | ||
| Slides | introduction.pdf | introduction.pptx | |
| Literature | [G] 1, 2.1 | |
| Exercises | lecture 1 | |
| Wednesday January 28 | ||
| Python basics variables, int, float, str, type conversion, assignment, print(), help(), type() Control structures if-elif-else, while-break-continue, input() | ||
| Slides | basics.pdf | basics.pptx control.pdf | control.pptx | |
| Videos | Basics 55:27 Control 32:09 | |
| Literature | [G] 2.2, 2.3, 2.5, 2.6 | |
| Exercises | lecture 2 handin 1 | |
| 6 | Monday February 2 | |
| Basic operations None, bool, basic operations, strings Exercise classes start | ||
| Slides | operations.pdf | operations.pptx | |
| Videos | Operations 1:02:04 | |
| Literature | [G] 2.4, 5.5 | |
| Exercises | lecture 3 | |
| Wednesday February 4 | ||
| Lists Syntax, operations, copy.deepcopy Control structures while-else, for-loops, for-break-continue-else, range | ||
| Slides | lists.pdf | lists.pptx | |
| Videos | Lists 1:00:04 | |
| Literature | [G] 5.2, 5.3, 5.4, 5.5 | |
| Exercises | lecture 4 handin 2 | |
| 7 | Monday February 9 | |
| Tuples and lists tuples, lists, mutability, list comprehension, for-if, for-for, list(), any(), all(), enumerate(), zip() | ||
| Slides | tuple.pdf | tuple.pptx | |
| Videos | Tuples 50:13 Orientation test 11:38 | |
| Literature | [G] 5.1, 5.3, 5.5 | |
| Exercises | lecture 5 | |
| Wednesday February 11 | ||
| Dictionaries and sets dict, set, frozenset, dictionary comprehension, set comprehension, collections, deque, namedtuple, Counter | ||
| Slides | dictionaries.pdf | dictionaries.pptx | |
| Videos | Dictionaries 49:51 Handins 3-4 5:11 | |
| Literature | [G] 5.6, 5.7, 5.8, 12.3 | |
| Exercises | lecture 6 handin 3 | |
| 8 | Monday February 16 | |
| Functions functions, return, scoping, arguments, keyword arguments, *, **, global variables 10.15 Meeting with class representatives | ||
| Slides | functions.pdf | functions.pptx | |
| Videos | Functions 58:04 | |
| Literature | [G] 4, 6.3 | |
| Exercises | lecture 7 | |
| Wednesday February 18 | ||
| Recursion symbol table, stack frames | ||
| Slides | recursion.pdf | recursion.pptx | |
| Videos | Recursion 46:29 | |
| Literature | [G] 6.1, 6.2 | |
| Exercises | lecture 8 handin 4 | |
| 9 | Monday February 23 | |
| Recursion and iteration algorithm examples No physical lecture - video only | ||
| Slides | recursion_iteration.pdf | recursion_iteration.pptx | |
| Videos | Recursion and iteration 57:43 | |
| Literature | [G] 3, 12.1, 12.2 | |
| Exercises | lecture 9 handin 5 | |
| Wednesday February 25 | ||
| Functions as objects lambda, higher-order functions, map, filter, reduce No physical lecture - video only | ||
| Slides | lambda.pdf | lambda.pptx | |
| Videos | Lambda 44:05 | |
| Literature | [G] 4.4, 12.2.2 | |
| Exercises | lecture 10 | |
| 10 | Monday March 2 | |
| Object oriented programming classes, objects, self, construction, encapsulation | ||
| Slides | classes.pdf | classes.pptx | |
| Videos | Classes 1:11:42 | |
| Literature | [G] 10.1, 10.3.0 | |
| Exercises | lecture 11 | |
| Wednesday March 4 | ||
| Class hierarchies inheritance, method overriding, super, multiple inheritance | ||
| Slides | hierarchies.pdf | hierarchies.pptx | |
| Videos | Class hierarchies 44:20 | |
| Literature | [G] 10.2 | |
| Exercises | lecture 12 handin 6 | |
| 11 | Monday March 9 | |
| Exceptions and file input/output try-raise-except-finally, Exception, control flow, match-case, file open/read/write, sys.stdin, sys.stdout, sys.stderr, context manager | ||
| Slides | exceptions.pdf | exceptions.pptx | |
| Videos | Exceptions 28:51 Files 20:13 Sudoku 15:45 | |
| Literature | [G] 7.3, 9.1, 9.2 | |
| Exercises | lecture 13 | |
| Wednesday March 11 | ||
| Documentation, testing and debugging docstring, defensive programming, assert, test driven developement, assertions, testing, unittest, doctest, debugger, coverage, static type checking, mypy | ||
| Slides | testing.pdf | testing.pptx | |
| Videos | Testing 48:44 Mypy 13:32 | |
| Literature | [G] 4.2, 8, 9.3 | |
| Exercises | lecture 14 handin 7 | |
| 12 | Monday March 16 | |
| Decorators @, @property, @functools.total_ordering, dataclasses | ||
| Slides | decorators.pdf | decorators.pptx | |
| Videos | Decorators 54:37 | |
| Exercises | lecture 15 | |
| Wednesday March 18 | ||
| Dynamic programming memoization, decorator memoized/functools.cache, systematic subproblem computation | ||
| Slides | dynamic_programming.pdf | dynamic_programming.pptx | |
| Videos | Dynamic programming 56:46 Coding competitions 10:47 | |
| Literature | [G] 14.1, 15.1, 15.2 | |
| Exercises | lecture 16 handin 8 | |
| 13 | Monday March 23 | |
| Visualization and optimization Matplotlib, Jupyter, scipy.optimize.minimize | ||
| Slides | optimization.pdf | optimization.pptx | |
| Videos | Matplotlib 1:03:40 Jupyter 26:35 SciPy minimize 29:47 | |
| Literature | [G] 13 | |
| Exercises | lecture 17 | |
| Wednesday March 25 | ||
| Multi-dimensional data NumPy, matrix multiplication, @, numpy.linalg.solve, numpy.polyfit | ||
| Slides | numpy.pdf | numpy.pptx | |
| Videos | Numpy 42:09 Polyfit 6:12 Numpy matplotlib 15:27 | |
| Literature | [G] 13.2 | |
| Exercises | lecture 18 | |
| 14 | Monday March 30 - Monday April 6 | |
| Easter break - no teaching | ||
| 15 | Tuesday April 7 - Wednesday April 8 | |
| No lectures and exercise classes | ||
| 16 | Monday April 13 | |
| Linear programming scipy.optimize.linprog pagerank.ipynb max-flow.ipynb | ||
| Slides | linear_programming.pdf | linear_programming.pptx | |
| Videos | Linprog 6:19 Maxflow 10:05 Pagerank 22:17 | |
| Exercises | lecture 19 handin 9 | |
| Wednesday April 15 | ||
| Generators and iterators yield, __iter__, __next__, measuring memory usage | ||
| Slides | generator.pdf | generator.pptx | |
| Videos | Iterators 38:26 Generators 30:04 Memory usage 9:27 | |
| Literature | [G] 10.3.1 | |
| Exercises | lecture 20 handin 10 | |
| 17 | Monday April 20 | |
| Modules and packages from-import-as, __name__, "__main__", heapq | ||
| Slides | modules.pdf | modules.pptx | |
| Videos | Modules 24:28 Heapq 8:51 | |
| Literature | [G] 7.1, 7.2 | |
| Exercises | lecture 21 | |
| Wednesday April 22 | ||
| Working with text file formats (CSV, Json, XML, Excel), regular expressions (module re), finditer | ||
| Slides | text.pdf | text.pptx | |
| Videos | File formats 39:47 Regular expressions 17:59 Lindenmeyer systems 14:10 | |
| Exercises | lecture 22 | |
| 18 | Monday April 27 | |
| Relational data SQL, SQLite, pandas pandas.ipynb | ||
| Slides | pandas.pdf | pandas.pptx | |
| Videos | SQLite 29:23 Pandas 34:23 | |
| Literature | [G] 23 | |
| Exercises | lecture 23 | |
| Wednesday April 29 | ||
| Clustering k-means, scipy.cluster.vq.kmeans, DBSCAN, neural networks | ||
| Slides | clustering.pdf | clustering.pptx | |
| Videos | Clustering 27:25 DBSCAN 11:11 Neural networks 15:56 | |
| Literature | [G] 25 | |
| Exercises | lecture 24 | |
| 19 | Monday May 4 | |
| Graphical user interfaces (GUI) Tkinter, qt | ||
| Slides | gui.pdf | gui.pptx | |
| Videos | Tkinter 50:37 | |
| Exercises | lecture 25 | |
| Wednesday May 6 | ||
| Java vs Python | ||
| Slides | java.pdf | java.pptx | |
| Videos | Java 1:03:03 | |
| Exercises | lecture 26 | |
| 20 | Monday May 11 | |
| Follow up on course evaluation, discussion of exam | ||
| Slides | exam.pdf | exam.pptx | |
| Exercises | lecture 27 | |
| Wednesday May 13 | ||
| No lecture | ||
| Wednesday May 13 | ||
| Hollyday (Ascension Day) - no teaching | ||
| Friday May 15 | ||
| Last day of semester | ||
| 22 | Sunday May 31 | |
| Project deadline 23:59 | ||
| June | ||
| Questions & answers sessions | ||
| 25 | Saturday June 20 | |
| Exam | ||