Is there any possibility to parallelize the following code in python? I was wondering how to convert this code with map and lambda functions..
values = (1,2,3,4,5 )
def op(x,y):
return x+y
[(i, j, op(i, j))
for i in values
for j in values
if i is not j]
You can parallelize the function op with multiprocessing and map:
Check this out:
It's in python's stdlib.
If you want run in parallel, check out this using python3: