Python 3: Deep Dive (Part 3 – Hash Maps)

Python 3: Deep Dive (Part 3 – Hash Maps)
Python 3: Deep Dive (Part 3 – Hash Maps)
English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 20.5 Hours | 2.26 GB

Dictionaries, Sets, and Related Data Structures

This course is an in-depth look at Python dictionaries.

Dictionaries are ubiquitous in Python. Classes are essentially dictionaries, modules are dictionaries, namespaces are dictionaries, sets are dictionaries and many more.

In this course we’ll take an in-depth look at:

  • associative arrays and how they can be implemented using hash maps
  • hash functions and how we can leverage them for our own custom classes
  • Python dictionaries and sets and the various operations we can perform with them
  • specialized dictionary structures such as OrderedDict and how it relates to the built-in Python3.6+ dict
  • Python’s implementation of multi-sets, the Counter class
  • the ChainMap class
  • how to create custom dictionaries by inheriting from the UserDict class
  • how to serialize and deserialize dictionaries to JSON
  • the use of schemas in custom JSON deserialization
  • a brief introduction to some useful libraries such as JSONSchema, Marshmallow, PyYaml and Serpy

Please note that this is a relatively advanced Python course, and a strong knowledge of some topics in Python is required.

Beyond the basics of Python (loops, conditional statements, exception handling, built-in data types, creating classes, etc), you should also have an in-depth understanding of the following topics:

  • functions and functional programming (recursion, *args, **kwargs, zip, map, sorted, any, all, etc)
  • lambdas, closures and decorators (including standard decorators such as @singledispatch, @wraps, etc)
  • iterables, iterators, generators and context managers
  • named tuples
  • variable scopes and namespaces (globals, locals, etc)

For this course you will also need to install some 3rd party libraries, so you need to be comfortable with doing this using the tool of your choice (e.g. pip, conda, etc)

Finally, most of the code in this course is illustrated using the freely available Jupyter Notebooks, so you will need that as well.

What you’ll learn

  • Associative Arrays
  • Hash Tables and Hash Functions
  • Python’s implementation of hash tables
  • Dictionaries and Sets
  • Defining hash functions for our custom classes and why that is useful
  • Creating customized dictionaries using the UserDict class
  • defaultdict
  • OrderedDict and Python3.6+ equivalences
  • Counter (multi-sets)
  • ChainMap
  • Serialization and Deserialization
  • JSON serialization/deserialization
  • Intro to JSONSchema, Marshmallow, PyYaml and Serpy 3rd party libraries
Table of Contents

Introduction
1 Course Overview
2 Prerequisites

Associative Arrays – Theory!
3 Introduction
4 Associative Arrays
5 Hash Maps
6 Python Dictionaries
7 Python’s hash() Function

Dictionaries
8 Introduction
9 Creating Dictionaries – Lecture
10 Creating Dictionaries – Coding
11 Common Operations – Lecture
12 Common Operations – Coding
13 Dictionary Views – Lecture
14 Dictionary Views – Coding
15 Updating, Merging, and Copying – Lecture
16 Updating, Merging, and Copying – Coding
17 Custom Classes and Hashing – Lecture
18 Custom Classes and Hashing – Coding

Coding Exercises
19 Exercises
20 Solution 1
21 Solution 2
22 Solution 3
23 Solution 4

Sets
24 Introduction
25 Basic Set Theory
26 Python Sets
27 Creating Sets – Lecture
28 Creating Sets – Coding
29 Common Operations – Lecture
30 Common Operations – Coding
31 Set Operations – Lecture
32 Set Operations – Coding
33 Update Operations – Lecture
34 Update Operations – Coding
35 Copying Sets – Lecture
36 Copying Sets – Coding
37 Frozen Sets – Lecture
38 Frozen Sets – Coding
39 Dictionary Views – Lecture
40 Dictionary Views – Coding

Project 1
41 Project 1 – Goals
42 Project 1 – Solution

Serialization and Deserialization
43 Introduction
44 Pickling – Lecture
45 Pickling – Coding
46 JSON Serialization – Lecture
47 JSON Serialization – Coding
48 Custom JSON Encoding – Lecture
49 Custom JSON Encoding – Coding
50 Using JSONEncoder – Lecture
51 Using JSONEncoder – Coding
52 Custom JSON Decoding – Lecture
53 Custom JSON Decoding – Coding
54 Using JSONDecoder – Lecture
55 Using JSONDecoder – Coding
56 JSON Schema
57 Marshmallow
58 PyYaml
59 Serpy

Coding Exercises
60 Exercises
61 Solution 1
62 Solution 2
63 Solution 3

Specialized Dictionaries
64 Introduction
65 DefaultDict – Lecture
66 DefaultDict – Coding
67 OrderedDict – Lecture
68 OrderedDict – Coding
69 OrderedDict and Python 3.6 Dicts
70 Counter – Lecture
71 Counter – Coding
72 ChainMap – Lecture
73 ChainMap – Coding
74 UserDict – Lecture
75 UserDict – Coding

Coding Exercises
76 Exercises
77 Solution 1
78 Solution 2
79 Solution 3