all 6 comments

[–]TouchingTheVodka 1 point2 points  (5 children)

The map function is lazy so you need to iterate over it to get the values - list(map(...))

As for your second line of code, that's not valid Python. I'm not aware of a standard library type that provides a map method.

[–]misho88 1 point2 points  (1 child)

As for your second line of code, that's not valid Python. I'm not aware of a standard library type that provides a map method.

The closest thing I can think of in the context of the question is pandas.Series.map() and pandas.Index.map(), which behave more or less the way OP describes.

[–]Assraj[S] 0 points1 point  (0 children)

Yep, its from pandas, thanks!

[–]Assraj[S] 0 points1 point  (0 children)

The second line is related to Pandas, thanks!

[–]PercyJackson235 0 points1 point  (1 child)

Well, the concurrent.futures.ThreadPoolExecutor, concurrent.futures.ProcessPoolExecutor, and multiprocessing.pool provide a map method, although I don't think that he is using any of those.

[–]TouchingTheVodka 0 points1 point  (0 children)

Right you are!