Skip to content

Glossary: Probability for ML

Dict comprehension

Also written: dictionary comprehension

A one-line way to build a Python dict, such as `{c: 0 for c in classes}`. It's the dict version of a list comprehension.

Where the book teaches it

Related terms

List comprehension