Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python parallelize for loop progressbar

from tqdm.contrib.concurrent import process_map
from multiprocessing import cpu_count

def my_func(param):
   # do stuff - param will be one of [1,2,3,4,5]
   return some_val

if __name__ == '__main__':
   my_vals = process_map(my_func, [1,2,3,4,5], max_workers=cpu_count())
 
PREVIOUS NEXT
Tagged: #python #parallelize #loop #progressbar
ADD COMMENT
Topic
Name
4+4 =