Skip to content

Glossary: Probability for ML

List comprehension

Also written: list (dict) comprehension, comprehension

A one-line Python way to build a list: `[f(x) for x in items]` runs the expression once per item and collects the results.

Where the book teaches it

Related terms

Dict comprehension