About 538,000 results
Open links in new tab
  1. python - Understanding the map function - Stack Overflow

    Jun 11, 2012 · 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: …

  2. 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 …

  3. python - Why use the map () function? - Stack Overflow

    Jun 9, 2014 · 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 …

  4. python - Most efficient way to map function over numpy array

    Feb 5, 2016 · 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 ...

  5. python - How to do multiple arguments to map function where …

    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 …

  6. Getting a map() to return a list in Python 3.x - Stack Overflow

    list(map(chr,[66,53,0,94])) In Python 3+, many processes that iterate over iterables return iterators themselves. In most cases, this ends up saving memory, and should make things go faster. If …

  7. python - How to use multiprocessing pool.map with multiple …

    In the Python multiprocessing library, is there a variant of pool.map which supports multiple arguments?

  8. python - Using the map function - Stack Overflow

    In Python 2, map would apply a function to the values of an iterable and return a list. In Python 3, map returns an iterator that applies the function to the iterated values as you loop over it.

  9. 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 …

  10. python - multiprocessing.Pool: When to use apply, apply_async or …

    Dec 16, 2011 · 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.