We may earn an affiliate commission when you visit our partners.
Course image
Dr. Fred Baptiste

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:

Read more

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

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.

Enroll now

What's inside

Learning objectives

  • 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
  • Show more
  • Show less

Syllabus

Introduction
Update Operations - Lecture
Course Overview
Prerequisites
Read more

I have archived this video, as I now really recommend using Pydantic and it's serialization/deserialization capabilities for most use cases.

I have a video on Pydantic here:

https://www.youtube.com/watch?v=gb3arRysqMo&list=PL9_iFHfnv8hBzIvrgk5qsE4VD7oUiAQ4E&index=1

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Assumes a strong foundation in Python, including functional programming, lambdas, iterators, and variable scopes, which is ideal for developers looking to deepen their understanding
Explores advanced dictionary structures like OrderedDict, Counter, and ChainMap, which are useful for optimizing data handling in complex applications
Covers JSON serialization/deserialization and introduces libraries like JSONSchema and PyYaml, which are essential for working with data exchange formats
Requires familiarity with installing 3rd party libraries using tools like pip or conda, which may pose a challenge for beginners
Uses Jupyter Notebooks for code illustration, so learners will need to be comfortable with this environment to follow along effectively
Includes coverage of Python 3.7, 3.8, 3.9, and 3.10 updates, which helps learners stay current with recent language features and improvements

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Deep dive python internals

According to students, this is an excellent course that provides a deep dive into Python dictionaries, sets, and JSON. Learners appreciate the thorough explanations of internal mechanisms, such as hashing and memory management, which builds a strong understanding of Python's fundamentals. The instructor is widely praised for his expertise and ability to explain complex topics clearly. While the course is highly valued for its depth and practical coding exercises, students emphasize that it is an advanced course that requires a solid foundation in Python prerequisites.
Advanced course requiring strong prior Python knowledge.
"Definitely requires a solid understanding of the prerequisites mentioned in the course description."
"This is not a beginner course; come prepared with a strong Python background."
"If you haven't completed the previous parts or similar advanced topics, you might struggle."
"Be sure you're comfortable with topics like generators, decorators, and closures before starting."
"It's challenging, but rewarding if you have the necessary prior knowledge."
Covers dictionaries, sets, JSON, and related topics.
"Provides comprehensive coverage of dictionaries, sets, and JSON handling."
"I appreciated the sections on specialized dictionaries like defaultdict and OrderedDict."
"The JSON serialization/deserialization part was particularly useful."
"Good introduction to related libraries like PyYaml and JSONSchema."
"Everything you need to know about Python's associative arrays is covered."
Hands-on coding reinforces theoretical concepts.
"The coding exercises and projects are excellent for applying what you learn."
"I found the practical coding examples very helpful in understanding the theory."
"Working through the notebooks alongside the lectures made the concepts stick."
"The project section really helped solidify my understanding of the material."
"Good balance between theory and practical implementation."
Instructor's expertise and clarity are highly valued.
"The instructor is incredibly knowledgeable and explains difficult concepts with ease."
"Once again, the instructor delivers complex topics in a way that is easy to follow."
"I've taken other courses by this instructor and he consistently provides high-quality content."
"His explanations of hashing and object equality were particularly insightful."
"The instructor's passion for the subject makes learning enjoyable."
Gain deep insights into Python's core mechanics.
"This course is really about understanding how Python works under the hood, specifically for dictionaries and sets."
"I appreciate the deep dive into hashing and how dictionaries and sets are implemented internally."
"It significantly deepened my understanding of how these data structures function at a lower level."
"Really makes you understand not just *how* to use dicts/sets, but *why* they work that way."
"Excellent for solidifying foundational knowledge on Python's internals."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Python 3: Deep Dive (Part 3 - Dictionaries, Sets, JSON) with these activities:
Review Python Fundamentals
Reinforce your understanding of core Python concepts like data types, loops, and functions to better grasp the advanced dictionary concepts covered in this course.
Browse courses on Python Basics
Show steps
  • Review Python documentation on data structures.
  • Practice writing basic Python functions.
  • Complete online Python tutorials for beginners.
Read 'Fluent Python'
Study the sections on dictionaries and data structures in 'Fluent Python' to gain a deeper understanding of Pythonic best practices.
Show steps
  • Obtain a copy of 'Fluent Python'.
  • Read the chapters related to dictionaries and data structures.
  • Experiment with the code examples provided in the book.
Implement Hash Functions
Practice implementing different hash functions to understand their impact on dictionary performance and collision resolution.
Show steps
  • Research different hash function algorithms.
  • Implement a few hash functions in Python.
  • Test the performance of each hash function with different datasets.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Read 'Effective Python'
Review the sections on dictionaries in 'Effective Python' to learn best practices for using dictionaries in your code.
Show steps
  • Obtain a copy of 'Effective Python'.
  • Read the items related to dictionaries.
  • Apply the recommendations to your Python projects.
Write a Blog Post on JSON Serialization
Explain the concepts of JSON serialization and deserialization in Python, including custom encoding and decoding techniques.
Show steps
  • Research JSON serialization and deserialization in Python.
  • Write a clear and concise blog post explaining the concepts.
  • Include code examples to illustrate the techniques.
Build a Custom Dictionary Class
Create a custom dictionary class inheriting from UserDict to solidify your understanding of dictionary internals and customization.
Show steps
  • Design the custom dictionary class with specific features.
  • Implement the required methods for the custom dictionary.
  • Test the custom dictionary class thoroughly.
Create a JSON Schema Validator
Develop a tool that validates JSON data against a predefined schema, reinforcing your understanding of JSON Schema and its applications.
Show steps
  • Choose a Python library for JSON Schema validation.
  • Study the JSON Schema specification.
  • Implement the validator tool with custom error handling.

Career center

Learners who complete Python 3: Deep Dive (Part 3 - Dictionaries, Sets, JSON) will develop knowledge and skills that may be useful to these careers:
Software Developer
A software developer builds applications, often using object-oriented languages like Python. This course on Python dictionaries, sets, and JSON helps build a foundation for efficient data manipulation, a critical skill for any software developer. By understanding how dictionaries work, how to customize them, and how to serialize and deserialize them to JSON, a software developer can improve the performance and structure of their applications. This course helps one understand Python's implementation of hash tables, hash functions, specialized dictionary structures, and more. These components are heavily used in software development, so this course is designed to help a software developer become more effective in their job.
Data Engineer
This course can help a data engineer in their everyday tasks, as data engineers design, build, and maintain the infrastructure that enables data analysis. This course specifically focuses on Python dictionaries, sets, and JSON. The ability to handle them efficiently is important for any data engineer. A data engineer will need to work with data in various formats, and by mastering how to serialize and deserialize dictionaries using JSON, they can easily move data between systems without compatibility issues. Also, understanding hash tables, custom classes, and specialized dictionaries will improve the data engineer's ability to optimize data storage and access.
Backend Developer
A backend developer focuses on the server-side logic of applications. This course is relevant to the role since backend developers often deal with data in various formats. The course's deep dive into Python dictionaries, including how they use hash maps, is essential for efficient data handling. Additionally, the course's modules on JSON serialization/deserialization will help a backend developer work with APIs and databases by storing data in standard formats. The covered topics like customized dictionaries using the UserDict class, defaultdict, OrderedDict, and Python’s implementation of multi sets will also aid a backend developer in writing more efficient backend code.
Data Scientist
Data scientists use data to derive insights and build models. A core focus of this course is understanding Python dictionaries, and how to serialize and deserialize them using JSON. These concepts are crucial for data scientists, as they often work with structured and semi-structured data. Being able to manipulate, store, and retrieve data efficiently is extremely important for the job. The course's investigation into hash tables, custom classes, specialized dictionary structures, and more will be tremendously helpful to a data scientist. Because of the course’s detailed coverage of these topics, a data scientist can better prepare data for analysis and improve the efficiency of their code.
Machine Learning Engineer
Machine learning engineers develop and deploy machine learning models. Understanding deep data structures is critical for this role, and this course provides an in-depth look at Python dictionaries, sets, and JSON. This course can help a machine learning engineer understand how hash maps can be used to improve the efficiency of data processing and model training. The skills gained from this course are important to understand, as models are often deployed using JSON to transmit and receive data. A machine learning engineer should prioritize this course because it delivers a strong understanding of Python’s data structures.
Python Developer
A Python developer specializes primarily in the Python programming language to create various applications. Dictionaries are a fundamental part of the Python language. They are used in a variety of ways, and this course examines them closely. This course delivers great value to an aspiring Python developer by providing a comprehensive understanding of how they are implemented. The course will also enable a developer to create custom dictionaries, which can lead to more efficient and cleaner code. By mastering these techniques and topics, a Python developer will find this course is particularly helpful.
API Developer
API developers build and maintain application programming interfaces. This course can be helpful because it studies how to serialize and deserialize dictionaries using JSON. APIs rely heavily on JSON to send and receive data between applications. An API developer will benefit from the course's examination of schemas in custom JSON deserialization and its introduction to useful libraries like JSONSchema. The course’s focus on dictionaries, hash tables, and more helps an API developer better understand how to efficiently build, process and use data structures in the development of APIs.
Database Administrator
A database administrator manages and maintains databases. This course will likely help a database administrator in their job, as it teaches how to serialize and deserialize data from Python to JSON. Understanding these details helps the database administrator work with data in various formats. A database administrator can improve data access, storage, and manipulation techniques by better understanding hash tables, custom classes, and the specialized dictionary structures covered in this course. They should especially understand the Python implementations of dictionaries and their properties.
Software Architect
A software architect designs the structure of software and systems. This course may be useful for the job by improving the architect's understanding of how essential data structures operate. This course’s focus on Python dictionaries, including their implementation using hashmaps, as well as its focus on serialization and deserialization to JSON, are key for any architect. The course’s concepts help a software architect make informed decisions about the best way to structure data for efficient processing and storage. By learning about custom dictionaries and specialized structures, a software architect can better design systems.
Systems Analyst
A systems analyst studies computer systems and recommends ways to improve their efficiency and effectiveness. This course may be helpful to a systems analyst, in particular, regarding data structures and how to serialize and deserialize them in Python. The course's detailed look at dictionaries and how to customize them using the UserDict class will benefit a systems analyst, as will its analysis of the ChainMap class, Counter class, and specialized dictionary structures. The knowledge gained from this course will likely improve any systems analyst’s ability to manage data effectively.
DevOps Engineer
DevOps engineers manage software deployments and infrastructure. This course may be helpful for DevOps engineers. They often use configuration files in JSON format. The course provides instruction on how to serialize and deserialize dictionaries to JSON and how to create schemas; this is very relevant for a DevOps engineer. This course's examination of custom dictionaries, including UserDict, OrderedDict, and similar structures, may also be useful to understand data handling, and help in the automation of tasks and other DevOps functions.
Research Scientist
Research scientists often work with large datasets and complex data structures. This course may be useful for a research scientist because it provides detailed coverage of Python dictionaries, sets and how to serialize/deserialize data. The ability to efficiently handle and manipulate these data structures is important for research. This course focuses on how hash tables work, how to use custom classes and also discusses the use of third party libraries. This course may help researchers handle their data better.
Technical Consultant
Technical consultants provide expert advice to businesses regarding their technology needs. This course may be helpful for a technical consultant, as it covers the topic of efficient data manipulation in Python with dictionaries and JSON. A technical consultant can use this knowledge when working with clients who use Python, as the course discusses in detail custom dictionary structures, hash tables, and serialization/deserialization techniques. This may improve their ability to make informed recommendations and provide strategic advice to clients.
Academic Researcher
Academic researchers often use programming tools for data analysis as part of their work. This course may be useful, as it provides a detailed look at Python dictionaries and how to serialize and deserialize them using JSON and other tools. Academic researchers can improve how they handle data by understanding the course's topics, including hash tables, custom dictionaries, and specialized dictionary structures. The course may help researchers manage their data and improve the efficiency of their research projects.
Technical Writer
Technical writers create documentation for software and technical products. This course may be helpful for a technical writer that needs to understand Python data structures and JSON. The course provides detailed knowledge of dictionaries, sets, and JSON, which are necessary for documenting Python-based systems. Although technical writers do not need to write code, knowledge of how data is structured and used is helpful for accurate and comprehensive documentation. This course may help them better understand and explain the systems they are documenting.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Python 3: Deep Dive (Part 3 - Dictionaries, Sets, JSON).
Provides a deep dive into Python's core features, including dictionaries and data structures. It offers a comprehensive understanding of Pythonic idioms and best practices. It is particularly useful for understanding the underlying mechanisms of dictionaries and how to leverage them effectively. This book valuable resource for both intermediate and advanced Python programmers.
Offers practical advice on writing clean, efficient, and maintainable Python code. It covers a wide range of topics, including dictionaries, with specific recommendations for improving code quality. It is more valuable as additional reading than as a current reference. This book is commonly used by industry professionals to improve their Python skills.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser