About 8,770,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 …

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

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

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

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

  5. 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, 1 month ago Modified 4 years, 1 month ago Viewed 8k times

  6. python - How can I get the return value of a function passed to ...

    Dec 1, 2016 · In the example code below, I'd like to get the return value of the function worker. How can I go about doing this? Where is this value stored? Example Code: import …

  7. python map function (+ lambda) involving conditionals (if)

    python map function (+ lambda) involving conditionals (if) Asked 10 years, 4 months ago Modified 3 years, 11 months ago Viewed 26k times

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

  9. python - Check if a given key already exists in a dictionary - Stack ...

    I wanted to test if a key exists in a dictionary before updating the value for the key. I wrote the following code: if 'key1' in dict.keys(): print "blah" else: print "boo" I think this is not...

  10. python - Difference between map, applymap and apply methods …

    Can you tell me when to use these vectorization methods with basic examples? I see that map is a Series method whereas the rest are DataFrame methods. I got confused about apply and …