Manipulate Collections using comprehensions¶
Comprehensions is alternative way of manipulating lists using conventional loops.
- Comprehensions reduce the effort of coding and improves readability when we want to apply basic transformations on the data.
- We can apply comprehensions on lists, sets as well as dicts.
- We can create a new list or set or dict using comprehensions by applying simple row level transformations. We can also filter as part of the comprehensions.
- We can also perform simple aggregations using comprehensions.