Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pool.map multiple arguments

def unpack_args(func):
    from functools import wraps
    @wraps(func)
    def wrapper(args):
        if isinstance(args, dict):
            return func(**args)
        else:
            return func(*args)
    return wrapper

@unpack_args
def func(x, y):
    return x + y
  
results = pool.map(func, zip(x,y)) # The function will now pass the variables as lists
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #multiple #arguments
ADD COMMENT
Topic
Name
3+4 =