Im trying to construct a dataframe from the inputs of a function as well as the output. Previously I was using for loops
for i in range(x):
for j in range(y):
k = func(i, j)
(Place i, j, k into dataframe)
However the range was quite big so I tried to speed it up with multiprocessing.Pool()
with mp.Pool() as pool:
result = pool.starmap(func, ((i, j) for j in range(y) for i in range(x))
(Place result into dataframe)
However with pool I no longer have access to i and j as they are merely inputs into the function
I tried to get the function to return the inputs but that doesn't really make sense as the number of for loops increases, hence how to get the iterables passed into starmap?