Lesson 1.210mBeginner29.8k students
Comprehensions and iteration
A comprehension is a filter and a transform in one line. Readable when the logic is small, unreadable the moment you nest three of them.
This lesson sits in Python Foundations for Data, part of Python for Data Work. It assumes what came before it and leads directly into the next lesson in the module.
In this lesson you will
- Transform and filter a sequence in one expression
- Build dict and set comprehensions
- Know when a plain loop is clearer
Resources
Your notes for this lesson will appear here.