ubuntu2004
Course structure
Week | Week beginning | Lecture | Self-study Notebooks | Exercise Notebooks | Workshop Notebooks | Assessment |
---|---|---|---|---|---|---|
1 | 21 Sept. | Python | Python 1 to 4 | Python 3 and 4 | ||
2 | 28 Sept. | Python 5 to 9 | Python 5 to 9 | Python Workshop 1 | ||
3 | 5 Oct. | Python 10 to 14 | Python 10 to 14 | Python Workshop 2 | Python 1 | |
4 | 12 Oct. | Python 15 to 18 | Python 15 to 18 | Python Workshop 3 | Python 2 | |
5 | 19 Oct. | Python 19 to 23 | Python 19 to 23 | Python Workshop 4 | Python 3 | |
6 | 26 Oct. | EDA | EDA 1 to 3 | EDA 1 to 3 | Python Workshop 5 | Python 4 |
7 | 2 Nov. | EDA 4 to 7 | EDA 4 to 7 | EDA Workshop 1 | EDA 1 | |
8 | 9 Nov. | EDA 8 to 12 | EDA 9, 10 and 12 | EDA Workshop 2 | EDA 2 | |
9 | 16 Nov. | EDA Workshop 3 | EDA 3 | |||
10 | 23 Nov. | Data Analysis |
Python self-study and workshop notebooks
1 - Coding in Jupyter Notebooks
Command mode and edit mode
Markdown cells
Code cells
Running code cells
The Jupyter Kernel
Restarting the kernel
Help with Jupyter Notebooks
2 - Hello World
Hello, World!
Making mistakes and Python errors
Comments
Using google to help you code
3 - Numbers and arithmetic
Simple arithmetic
Jupyter Notebook output
Precedence: The order of calculations matter
Number types: integers and floats
Integer division and remainder (modulus)
Rounding numbers
Very large and very small numbers: Scientific E-notation
4 - Numerical variables
What are variables and why do we need them?
Properties of Python variables
Printing the value and type of a variable
The value of a variable can change
Variables can be used in arithmetic
Make your output meaningful with f-strings
What should I call my variable?
Variable naming guidelines
Reserved keywords in Python
Python Workshop 1: Getting started with Python
5 - Strings I - working with text
Length of a string
String variables
The empty string
Adding to the end of a string: Concatenation
Input
Casting: Converting a string to a number
Newlines and tabs: Escape characters
6 - Strings II - indicies and substrings
Accessing characters in a string
Accessing several characters: Substrings
Stepping over characters
Reversing a string
7 - Strings III - string methods
Manipulating and interrogating strings with string methods
Getting the index of a character or substring
Converting a string to lowercase
8 - Making decisions I - conditional statements
if
Indentation matters: IndentationError
if
...else
if
...elif
...else
Double equals symbol,
==
Testing strings
Test the value of a string
Test if a character is in a string
Test if a word is in a string
Tables of operators
9 - Making decisions II - combined and nested conditions
Combined conditions
The
and
operatorThe
or
operator
Combining
and
andor
operatorsNested conditions
Booleans
Python Workshop 2: Strings and making decisions
10 - Loops I - strings
Looping through a string
The iterating variable
Counting "f"s
Naming the iterating variable
11 - Lists
A list is a sequence of items
Length of a list
Creating an empty list
Adding items to a list: append()
Sorting a list
Accessing values in a list
Accessing individual items
IndexError
Accessing multiple items: slicing
Testing membership of a list
Getting the index of an item
12 - Loops II - lists
Looping through a list of strings
Looping through a list of numbers
Sum the values in a list
Average value of items in a list
13 - Loops III - controlling and nesting loops
Breaking out of a loop:
break
Nested loops
14 - Loops IV - looping by index
How
range()
worksUsing
range()
to loop through stringsA realistic example of looping through a string: Extracting codons
Using
range()
to loop through listsSimultaneous looping through multiple lists
Python Workshop 3: Lists and loops
15 - Dictionaries I - the basics
Dictionaries comprise items of key:value pairs
Dictionary keys are unique
Dictionary values do not need to be unique
Getting the number of items
Getting the value of a key
KeyError
Adding an item
Change the value of an item
Creating an empty dictionary
Test if a key is already in a dictionary
16 - Dictionaries II - looping
Looping through a dictionary
Looping through keys and values simultaneously
Loop through the keys and use them to get each item's value
Loop through items
Loop through sorted keys
Loop through reverse sorted keys
Loop through sorted values: Advanced Python
17 - Dictionaries III - counting things
18 - Dictionaries IV - lookup table
Python Workshop 4: Dictionaries
19 - Functions I - defining
A simple function
How functions work
Functions must be defined before they are called
Doc-strings
20 - Functions II - passing arguments
Passing values (arguments) to functions
Variables can be arguments
Lists and dictionaries can be arguments
Functions can be arguments
Functions can take more than one argument
Parameters can have a default value
21 Functions III - returning values
Returning values from a function
Functions can return any type of variable
Functions can return more than one value