Introduction to Programming and Scientific Applications (Spring 2019)

Course plan

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