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

    Jun 11, 2012 · The Python 2 documentation says: Built-in Functions: map (function, iterable, ...) Apply function to every item of iterable and return a list of the results. If additional iterable arguments are pa...

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

    In Python 2, it's necessary to provide the length argument to repeat(), since map() will run until the longest iterator is exhausted in that version of Python, filling in None for all missing values. Saying …

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

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

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

    Sep 1, 2012 · Mutating Dictionary Values In Place Using Zip And Map 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 …

  6. dictionary - How to use map and set on Python - Stack Overflow

    Sep 9, 2021 · How to use map and set on Python Asked 4 years, 2 months ago Modified 4 years, 2 months ago Viewed 8k times

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

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

  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. python map() on zipped object - Stack Overflow

    Dec 1, 2016 · 29 map doesn't unpack the iterables as your function argument, but instead as a more general way for dealing with such problems you can use starmap() function from itertools module …

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