Skip to content

Instantly share code, notes, and snippets.

@njsaunders
Created December 18, 2018 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njsaunders/3f364f1c68325a80fae016de0bffe284 to your computer and use it in GitHub Desktop.
Save njsaunders/3f364f1c68325a80fae016de0bffe284 to your computer and use it in GitHub Desktop.
Python Multiprocessing
from functools import partial
import pathos.multiprocessing as mp
input_list = [1,2,3,4,5]
def add_2(number):
return number + 2
pool = mp.ProcessingPool(50)
process_row = partial(add_2)
rows = pool.map(process_row, input_list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment