date | duration | maintainer | order | title |
---|---|---|---|---|
w01d03 |
50 |
larakattan |
4 |
Optional Python Advanced |
- (20 m) Advanced Python Datatypes
- (15 m) Deep and Shallow Copy
- (15 m) Pickle
The students will be:
- Familiar with DefaultDict
- Familiar with NamedTuples
- Familiar with Deques
- Understand the difference between a list and a generator
- Be familiar with
yield
vsreturn
and the purpose of generators
The students will:
- Understand how the memory is assigned (roughly)
- Understand why deep copy is necessary
- Know how to deep copy and when it is necessary.
The students will:
- Know what pickling is
- Understand how to dump/load an object
- Be familiar with how pickle can fit into their workflow
This notebook walks through some of the more niche data types available in the collections module. It also introduces the idea of generators and demonstrates the idea of a cursor. This notebook is heavily annotated and should act as a reference for students later.
This notebook introduces the concept of deep copying and shallow copying. Cartoons are included to illustrate where variables point in memory.
This notebook introduces the idea of pickling data. In particular, it focuses on the technique of dumping and loading from file in a byte format. There is also some discussion of how pickle can be added to a workflow to help control for data loss and to stop repeat procedures like needing to clean data every time a notebook starts. It also discusses breaking work into multiple notebooks that each do one job well (the first discussion of workflow).