The map() Function: Overview
In this section, you’ll learn more about the basics of functional programming, namely how to use the map()
function to transform data structures.
You’ll take an example data set represented using an immutable data structure from the previous videos in this course, and then you’ll create a transformed version of the same data using Python’s built-in map()
function. map()
is one of the functional programming primitives or building blocks available in Python. It’s useful in a number of contexts.
Later in the section, you’ll also see how map()
relates to list comprehensions and generator expressions and how using them is (arguably) more Pythonic that relying on plain map()
calls.
00:00 Hey guys! This is Dan Bader and this is the third part of my functional programming primitives in Python series. In the previous two tutorials, I gave you an intro to functional programming in Python. What is functional programming all about?
00:14
How can you represent data structures in Python so that they’re well suited for functional programming? How can you define immutable data structures? And in a previous tutorial, we talked about the filter()
function and how you can use it to filter down iterables or lists of items to a smaller output list based on some
00:37
arbitrary criteria. So, all very interesting stuff for nerds like myself and hopefully yourself. In this video, I’m going to introduce you to the map()
function in Python.
Become a Member to join the conversation.