Discussion on: Understanding map, filter, and zip in Python

paddy3118 profile image

But remember, in Python comprehensions should be the first try for what could be done in map and filter.

answer = [(x, x**2) for x in numbers if x % 2 == 0]
codespent profile image
Patrick Hanford Author

Absolutely, and thanks for commenting this, I hope everyone sees this as well!

waylonwalker profile image
Waylon Walker

Compressions can typically replace all 3 (map, filter, reduce) and can be used with zip.

The concepts here are still important to know. Libraries like pandas utilize the map syntax, or using a different language like JavaScript.