Python's map() Function: Transforming Iterables (Summary)
In this course, you’ve learned how map()
works and how to use it to process iterables. You also learned about some Pythonic tools that you can use to replace map()
in your code.
You now know how to:
- Work with Python’s
map()
- Use
map()
to process and transform iterables without using an explicit loop - Combine
map()
with functions likefilter()
andreduce()
to perform complex transformations - Replace
map()
with tools like list comprehensions and generator expressions
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.
00:00 All right! Well, we’ve come to the end of the course, so why don’t we summarize what you’ve learned?
00:06
I hope that you got a good understanding of how to use the map()
function and when to use it. Perhaps now, every now and then, instead of using a for
loop or maybe even a list comprehension, you go ahead and use the map()
function!
00:20
You might actually like it. Then we talked about combining the map()
function with the filter()
function and the reduce()
function, which are just some extra tools for you to use when you’re working with iterators. And then it was nice to know about the starmap()
function.
00:37
You know, sometimes you’re working with data and the data comes to you zipped up already, and instead of sort of breaking that data up, if you just want to map a function, then with this combined data you can use the starmap()
function.
00:52
These functions that we learned about fall into this general idea of using a more functional programming approach to your code. It’s a good idea to mix things up and help you think about code in a different way. That being said, there are some nice Pythonic alternatives to the map()
function and the reduce()
function and the filter()
function. So again, it’s good to know about these things.
01:16 You might see this in other people’s code and you just want to know about them. It doesn’t hurt to know these general ideas.
01:26 Well, that just about wraps things up with the course. Thank you for watching and I hope that you learned something!
Cesar Aguilar RP Team on May 7, 2021
Thank you! Glad you enjoyed it.
mikaliae on June 7, 2021
Got many good ideas about how to solve a specific problem. Nice usage of built-in and library functions. Liked also the caesar cipher example. Thanks!
subinmath on Sept. 11, 2021
This was really great. Thanks!
aniketbarphe on Oct. 3, 2021
Thank You for valuable session!
Shubha on Nov. 2, 2021
Great Course, thank you!
Become a Member to join the conversation.
Maram-dev on May 6, 2021
Thank you for a great course!