= list(range(10))
test_array test_array
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
parallel (func, arr:Collection, max_workers:int=None, leave=False, use_threads=True)
Execute the function in parallel on the elements of the input collection.
Returns: results (list): A list of the results of the function execution
Type | Default | Details | |
---|---|---|---|
func | The function to be executed | ||
arr | typing.Collection | The input collection | |
max_workers | int | None | The maximum number of workers to use |
leave | bool | False | Whether to leave the progress bar after completion |
use_threads | bool | True | Whether to use threads or processes as workers |