About 52 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. How to use map () with dictionary comprehension in Python

    Jul 10, 2022 · I am fairly new to python and am getting confused with comprehensions in general, whether list or dictionary comprehensions. I did see you can use dict and/or zip but would like to …

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

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

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

  10. How to use the map () function correctly in python, with list?

    Feb 12, 2021 · arr = list(map(int, input().rstrip().split())) There's a variable arr which is being assigned the value to the statement on the right. On the right, the data is being fetched using the input method, …