About 485,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. 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 …

  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 - How to do multiple arguments to map function where …

    The docs explicitly suggest this is the main use for itertools.repeat: Make an iterator that returns object over and over again. Runs indefinitely unless the times argument is specified. Used as …

  5. Mapping over values in a python dictionary - Stack Overflow

    Sep 1, 2012 · Here is how I handle the situation of wanting to mutate the values of a dictionary using map without creating a new data structure or second dictionary. This will work on any …

  6. 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?

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

  8. When is it best to use a python map function with a user defined ...

    Jul 12, 2020 · Think about functions in Python as simply objects. Objects can be passed to functions and also can be returned from functions. This is actually functional-style …

  9. How to use map () with dictionary comprehension in Python

    Jul 10, 2022 · In this case, the dict comprehension is more Pythonic because it uses Python syntax features to good effect, making for easy to understand code. The second version might …

  10. How to use multiprocessing pool.map with multiple arguments

    @zthomas.nc this question is about how to support multiple arguments for multiprocessing pool.map. If want to know how to call a method instead of a function in a different Python …