Affiliate disclosure

Book titles on this page link to Amazon. As an Amazon Associate, DataField.Dev earns from qualifying purchases — at no additional cost to you.

Further Reading: Dictionaries and Sets

Python Documentation

  • Python Tutorial: Data Structures (Dictionaries section). (Tier 1) The official Python tutorial covers dict operations concisely. Start here for the authoritative reference on methods like .get(), .items(), .update(), and .pop(). Available at docs.python.org/3/tutorial/datastructures.html#dictionaries.

  • Python Documentation: collections module. (Tier 1) The official docs for defaultdict, Counter, OrderedDict, and ChainMap. The Counter class in particular has many useful methods beyond .most_common() that are worth exploring. Available at docs.python.org/3/library/collections.html.

Understanding Hash Tables

  • Downey, A. Think Python, 3rd Edition, Chapter 11: Dictionaries. (Tier 1) A complementary treatment of dictionaries with a stronger emphasis on implementation details. Downey explains hash tables with excellent diagrams. Free online at greenteapress.com.

  • Jennings, B. "Hash Tables — Data Structures." CS Dojo (YouTube). (Tier 2) A clear, visual explanation of how hash tables work under the hood. If you want to understand why dictionary lookup is O(1), this 15-minute video is a good starting point.

  • Cormen, T. et al. Introduction to Algorithms, 4th Edition, Chapter 11: Hash Tables. (Tier 1) The definitive academic treatment of hash tables, hash functions, and collision resolution. Significantly more advanced than what's needed for this course, but excellent if you're curious about the theory.

Practical Applications

  • Sweigart, A. Automate the Boring Stuff with Python, Chapter 5: Dictionaries and Structuring Data. (Tier 1) Practical dictionary examples focused on real-world automation tasks: tic-tac-toe boards, nested data, and a fantasy game inventory system. Free online at automatetheboringstuff.com.

  • Lutz, M. Learning Python, 6th Edition, Chapter 8: Lists and Dictionaries. (Tier 1) A thorough reference covering dictionary methods, iteration, and comparison with lists. More detailed than most introductory treatments.

JSON and Web Data

  • json.org: Introducing JSON. (Tier 1) The specification for JSON (JavaScript Object Notation). Compare the JSON data types with Python's — the mapping is almost one-to-one. This will prepare you for Chapter 10's file I/O content.

  • Mozilla Developer Network: Working with JSON. (Tier 2) While aimed at JavaScript developers, this MDN guide provides clear explanations of JSON structure that map directly to Python dicts. Available at developer.mozilla.org.

Sets and Mathematical Foundations

  • Rosen, K. Discrete Mathematics and Its Applications, Chapter 2: Sets. (Tier 1) If you want to understand the mathematical foundations of set operations, this textbook provides rigorous definitions of union, intersection, difference, complement, and power sets.

Performance and Big-O

  • Hunner, T. "When to Use Dictionaries, Lists, Sets, and Tuples." (Talk, PyCon 2019). (Tier 2) A practical talk by a Python trainer that walks through real scenarios and benchmarks for choosing between Python's built-in data structures. Search for "Trey Hunner data structures PyCon" on YouTube.

For the Curious

  • Hettinger, R. "Modern Dictionaries" (Talk, PyCon 2017). (Tier 1) Raymond Hettinger, a Python core developer, explains how CPython's dictionary implementation was redesigned in Python 3.6 to use 20-25% less memory while maintaining insertion order. Technical but accessible if you enjoy understanding how things work under the hood.

  • Ramalho, L. Fluent Python, 2nd Edition, Chapter 3: Dictionaries and Sets. (Tier 1) An advanced treatment covering __hash__, __eq__, dict internals, set theory in Python, and MappingProxyType. Best read after completing this course, but an excellent next step.