Answers for "tqdm parallel"

1

tqdm parallel

from pqdm.processes import pqdm
# If you want threads instead:
# from pqdm.threads import pqdm

args = [1, 2, 3, 4, 5]
# args = range(1,6) would also work

def square(a):
    return a*a

result = pqdm(args, square, n_jobs=2)
Posted by: Guest on September-01-2021

Python Answers by Framework

Browse Popular Code Answers by Language