Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Parallel run of a function with multiple arguments partial map pool


>>> import functools

>>> partial_sum_four = functools.partial(sum_four, a, b, c)

>>> with Pool(processes=4) as pool:
         res = pool.map(partial_sum_four, ds)

>>> res
 [7, 8, 9, 10]
Source by miguendes.me #
 
PREVIOUS NEXT
Tagged: #Parallel #run #function #multiple #arguments #partial #map #pool
ADD COMMENT
Topic
Name
3+7 =