4.85 out of 5
4.85
323 reviews on Udemy

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

Dictionaries, Sets, and Related Data Structures
Instructor:
Fred Baptiste
8,552 students enrolled
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

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

***** Prerequisites *****

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.

Introduction

1
Course Overview
2
Prerequisites

Associative Arrays - Theory!

1
Introduction
2
Associative Arrays
3
Hash Maps
4
Python Dictionaries
5
Python's hash() Function

Dictionaries

1
Introduction
2
Creating Dictionaries - Lecture
3
Creating Dictionaries - Coding
4
Common Operations - Lecture
5
Common Operations - Coding
6
Dictionary Views - Lecture
7
Dictionary Views - Coding
8
Updating, Merging, and Copying - Lecture
9
Updating, Merging, and Copying - Coding
10
Custom Classes and Hashing - Lecture
11
Custom Classes and Hashing - Coding

Coding Exercises

1
Exercises
2
Solution 1
3
Solution 2
4
Solution 3
5
Solution 4

Sets

1
Introduction
2
Basic Set Theory
3
Python Sets
4
Creating Sets - Lecture
5
Creating Sets - Coding
6
Common Operations - Lecture
7
Common Operations - Coding
8
Set Operations - Lecture
9
Set Operations - Coding
10
Update Operations - Lecture
11
Update Operations - Coding
12
Copying Sets - Lecture
13
Copying Sets - Coding
14
Frozen Sets - Lecture
15
Frozen Sets - Coding
16
Dictionary Views - Lecture
17
Dictionary Views - Coding

Project 1

1
Project 1 - Goals
2
Project 1 - Solution

Serialization and Deserialization

1
Introduction
2
Pickling - Lecture
3
Pickling - Coding
4
JSON Serialization - Lecture
5
JSON Serialization - Coding
6
Custom JSON Encoding - Lecture
7
Custom JSON Encoding - Coding
8
Using JSONEncoder - Lecture
9
Using JSONEncoder - Coding
10
Custom JSON Decoding - Lecture
11
Custom JSON Decoding - Coding
12
Using JSONDecoder - Lecture
13
Using JSONDecoder - Coding
14
JSON Schema
15
Marshmallow
16
PyYaml
17
Serpy

Coding Exercises

1
Exercises
2
Solution 1
3
Solution 2
4
Solution 3

Specialized Dictionaries

1
Introduction
2
DefaultDict - Lecture
3
DefaultDict - Coding
4
OrderedDict - Lecture
5
OrderedDict - Coding
6
OrderedDict and Python 3.6 Dicts
7
Counter - Lecture
8
Counter - Coding
9
ChainMap - Lecture
10
ChainMap - Coding
11
UserDict - Lecture
12
UserDict - Coding

Coding Exercises

1
Exercises
2
Solution 1
3
Solution 2
4
Solution 3
You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
4.9
4.9 out of 5
323 Ratings

Detailed Rating

Stars 5
258
Stars 4
60
Stars 3
6
Stars 2
0
Stars 1
0
7411bc7b980e8a441d664e6ede0c5b46
30-Day Money-Back Guarantee

Includes

20 hours on-demand video
Full lifetime access
Access on mobile and TV
Certificate of Completion