Global web icon
stackoverflow.com
https://stackoverflow.com/questions/10973766/under…
python - Understanding the map function - Stack Overflow
The map() function is there to apply the same procedure to every item in an iterable data structure, like lists, generators, strings, and other stuff. Let's look at an example: map() can iterate over every item in a list and apply a function to each item, than it will return (give you back) the new list.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/35215161/most-…
python - Most efficient way to map function over numpy array - Stack ...
What is the most efficient way to map a function over a numpy array? I am currently doing: import numpy as np x = np.array([1, 2, 3, 4, 5]) # Obtain array of square ...
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/10834960/how-t…
python - How to do multiple arguments to map function where one remains ...
map(add, [1, 2, 3], 2) The semantics are I want to add 2 to every element of the array. But the map function requires a list in the third argument as well. Note: I am putting the add example for simplicity. My original function is much more complicated. And of course option of setting the default value of y in add function is out of question as it will be changed for every call.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/10212445/map-l…
python - Map list item to function with arguments - Stack Overflow
Is there any way to map list items to a function along with arguments? I have a list: pages = [p1, p2, p3, p4, p5...] And I have to call function myFunc corresponding to each list elements along w...
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/5442910/how-to…
How to use multiprocessing pool.map with multiple arguments
In the Python multiprocessing library, is there a variant of pool.map which supports multiple arguments?
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/1975250/when-s…
When should I use a Map instead of a For Loop? - Stack Overflow
55 map is useful when you want to apply the function to every item of an iterable and return a list of the results. This is simpler and more concise than using a for loop and constructing a list. for is often more readable for other situations, and in lisp there were lots of iteration constructs that were written basically using macros and map.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/24110825/why-u…
python - Why use the map () function? - Stack Overflow
You will notice that Python has some other functional programming functions such as reduce, filter, zip etc. map is part of this class of functions where although each implements a very simple function, when you combine these into a single statement you can get very powerful results.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/8533318/multip…
python - multiprocessing.Pool: When to use apply, apply_async or map ...
Pool.map (or Pool.apply)methods are very much similar to Python built-in map (or apply). They block the main process until all the processes complete and return the result.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/1303347/gettin…
Getting a map() to return a list in Python 3.x - Stack Overflow
>>> map(chr, [66, 53, 0, 94]) <map object at 0x00AF5570> How do I retrieve the mapped list (as in A above) on Python 3.x? Alternatively, is there a better way of doing this? My initial list object has around 45 items and id like to convert them to hex.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/17997959/how-t…
How to use map () to call methods on a list of objects
Can you explain the use of the lambda function? I thought map passed the elements of the list as parameters to the function. How does the lambda function accept the objects as parameters?