Python 3: Deep Dive (Part 3 – Dictionaries, Sets, JSON)

Python 3: Deep Dive (Part 3 – Dictionaries, Sets, JSON)

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 85 lectures (21h 56m) | 8.01 GB

Dictionaries, Sets, Related Data Structures, Serialization/Deserialization

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, PyYaml and Serpy

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
3 Course Slides

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

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

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

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

Project 1
42 Project 1 – Goals
43 Project 1 – Solution

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

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

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

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

Python Updates
81 Python 3.10
82 Python 3.9
83 Python 3.8 3.7

Extras
84 The MappingProxy Type

Archived
85 Marshmallow

Homepage